Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/libexec/rpc.rusersd prune disabled XIDLE support. the requir...



details:   https://anonhg.NetBSD.org/src/rev/f7384fd59f13
branches:  trunk
changeset: 359907:f7384fd59f13
user:      snj <snj%NetBSD.org@localhost>
date:      Wed Feb 28 23:45:56 2018 +0000

description:
prune disabled XIDLE support. the required X server extension hasn't been
around for a couple decades now. even if someone wanted to modernize this,
it wouldn't be appropriate for NetBSD, since we don't want programs in base
to be linked against X libs.

diffstat:

 libexec/rpc.rusersd/Makefile      |  12 +------
 libexec/rpc.rusersd/rusers_proc.c |  66 +-------------------------------------
 2 files changed, 3 insertions(+), 75 deletions(-)

diffs (126 lines):

diff -r e6deb041e51d -r f7384fd59f13 libexec/rpc.rusersd/Makefile
--- a/libexec/rpc.rusersd/Makefile      Wed Feb 28 23:08:30 2018 +0000
+++ b/libexec/rpc.rusersd/Makefile      Wed Feb 28 23:45:56 2018 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.18 2002/11/04 22:03:38 christos Exp $
+#      $NetBSD: Makefile,v 1.19 2018/02/28 23:45:56 snj Exp $
 
 .include <bsd.own.mk>
 
@@ -15,15 +15,5 @@
 DPADD+=        ${LIBRPCSVC}
 LDADD+=        -lrpcsvc
 
-.if exists(/usr/X11R6)
-XINCDIR=       /usr/X11R6/include
-XLIBDIR=       /usr/X11R6/lib
-.endif
-
-#.if defined(XINCDIR) && exists($(XINCDIR)/X11/extensions/xidle.h)
-#CPPFLAGS+=    -I$(XINCDIR) -DXIDLE
-#LDADD+=               -L$(XLIBDIR) -lXext -lX11
-#.endif
-
 .include <bsd.prog.mk>
 
diff -r e6deb041e51d -r f7384fd59f13 libexec/rpc.rusersd/rusers_proc.c
--- a/libexec/rpc.rusersd/rusers_proc.c Wed Feb 28 23:08:30 2018 +0000
+++ b/libexec/rpc.rusersd/rusers_proc.c Wed Feb 28 23:45:56 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rusers_proc.c,v 1.27 2011/08/30 17:06:20 plunky Exp $  */
+/*     $NetBSD: rusers_proc.c,v 1.28 2018/02/28 23:45:56 snj Exp $     */
 
 /*-
  *  Copyright (c) 1993 John Brezak
@@ -30,7 +30,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: rusers_proc.c,v 1.27 2011/08/30 17:06:20 plunky Exp $");
+__RCSID("$NetBSD: rusers_proc.c,v 1.28 2018/02/28 23:45:56 snj Exp $");
 #endif /* not lint */
 
 #include <sys/types.h>
@@ -53,12 +53,6 @@
 #include "rusers_proc.h"
 #include "utmpentry.h"
 
-#ifdef XIDLE
-#include <setjmp.h>
-#include <X11/Xlib.h>
-#include <X11/extensions/xidle.h>
-#endif
-
 #include <rpcsvc/rusers.h>     /* New version */
 static size_t maxusers3 = 0;
 static struct rusers_utmp *utmps;
@@ -89,57 +83,6 @@
 struct utmpidlearr *rusersproc_allnames_2_svc(void *, struct svc_req *);
 
 
-#ifdef XIDLE
-static Display *dpy;
-static sigjmp_buf openAbort;
-
-static int XqueryIdle(char *);
-static void abortOpen(int);
-
-static void
-abortOpen(int n)
-{
-       siglongjmp(openAbort, 1);
-}
-
-static int
-XqueryIdle(char *display)
-{
-       int first_event, first_error;
-       Time IdleTime;
-
-       (void)signal(SIGALRM, abortOpen);
-       (void)alarm(10);
-       if (!sigsetjmp(openAbort, 0)) {
-               if ((dpy = XOpenDisplay(display)) == NULL) {
-                       syslog(LOG_DEBUG, "cannot open display %s", display);
-                       return -1;
-               }
-               if (XidleQueryExtension(dpy, &first_event, &first_error)) {
-                       if (!XGetIdleTime(dpy, &IdleTime)) {
-                               syslog(LOG_DEBUG,
-                                   "%s: unable to get idle time", display);
-                               return -1;
-                       }
-               } else {
-                       syslog(LOG_DEBUG, "%s: Xidle extension not loaded",
-                           display);
-                       return -1;
-               }
-               XCloseDisplay(dpy);
-       } else {
-               syslog(LOG_DEBUG, "%s: server grabbed for over 10 seconds",
-                   display);
-               return -1;
-       }
-       (void)alarm(0);
-       (void)signal(SIGALRM, SIG_DFL);
-
-       IdleTime /= 1000;
-       return (IdleTime + 30) / 60;
-}
-#endif /* XIDLE */
-
 static int
 getarrays2(int ne)
 {
@@ -205,11 +148,6 @@
         * If this is an X terminal or console, then try the
         * XIdle extension
         */
-#ifdef XIDLE
-       if (display && *display && strchr(display, ':') != NULL &&
-           (idle = XqueryIdle(display)) >= 0)
-               return idle;
-#endif
        idle = 0;
        if (*tty == 'X') {
                long kbd_idle, mouse_idle;



Home | Main Index | Thread Index | Old Index