summaryrefslogtreecommitdiff
path: root/libexec
diff options
context:
space:
mode:
authorsnj <snj@NetBSD.org>2018-02-28 23:45:56 +0000
committersnj <snj@NetBSD.org>2018-02-28 23:45:56 +0000
commit3dd8b31cb3eec68cad88db00a2a4314778da634e (patch)
tree097b3d5109b00391f4113e139080a9625cc0e098 /libexec
parent939e83c71751dfa614c2849f05b297fd2c3bb898 (diff)
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 (limited to 'libexec')
-rw-r--r--libexec/rpc.rusersd/Makefile12
-rw-r--r--libexec/rpc.rusersd/rusers_proc.c66
2 files changed, 3 insertions, 75 deletions
diff --git a/libexec/rpc.rusersd/Makefile b/libexec/rpc.rusersd/Makefile
index 85db16fe69a..c525305d426 100644
--- a/libexec/rpc.rusersd/Makefile
+++ b/libexec/rpc.rusersd/Makefile
@@ -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 -DSUPPORT_UTMPX -DSUPPORT_UTMP
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 --git a/libexec/rpc.rusersd/rusers_proc.c b/libexec/rpc.rusersd/rusers_proc.c
index 173c7e03c4c..db1bb04a460 100644
--- a/libexec/rpc.rusersd/rusers_proc.c
+++ b/libexec/rpc.rusersd/rusers_proc.c
@@ -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 2011/08/30 17:06:20 plunky Exp $");
#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_svc(void *, struct svc_req *);
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;