Module Name:    src
Committed By:   snj
Date:           Wed Feb 28 23:45:56 UTC 2018

Modified Files:
        src/libexec/rpc.rusersd: Makefile rusers_proc.c

Log Message:
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.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/libexec/rpc.rusersd/Makefile
cvs rdiff -u -r1.27 -r1.28 src/libexec/rpc.rusersd/rusers_proc.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/libexec/rpc.rusersd/Makefile
diff -u src/libexec/rpc.rusersd/Makefile:1.18 src/libexec/rpc.rusersd/Makefile:1.19
--- src/libexec/rpc.rusersd/Makefile:1.18	Mon Nov  4 22:03:38 2002
+++ src/libexec/rpc.rusersd/Makefile	Wed Feb 28 23:45:56 2018
@@ -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 @@ CPPFLAGS+=-I${NETBSDSRCDIR}/usr.bin/who 
 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>
 

Index: src/libexec/rpc.rusersd/rusers_proc.c
diff -u src/libexec/rpc.rusersd/rusers_proc.c:1.27 src/libexec/rpc.rusersd/rusers_proc.c:1.28
--- src/libexec/rpc.rusersd/rusers_proc.c:1.27	Tue Aug 30 17:06:20 2011
+++ src/libexec/rpc.rusersd/rusers_proc.c	Wed Feb 28 23:45:56 2018
@@ -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 @@ __RCSID("$NetBSD: rusers_proc.c,v 1.27 2
 #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_names_2_s
 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 @@ getidle(const char *tty, char *display)
 	 * 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;

Reply via email to