diff options
| author | brezak <brezak@NetBSD.org> | 1993-06-11 01:10:14 +0000 |
|---|---|---|
| committer | brezak <brezak@NetBSD.org> | 1993-06-11 01:10:14 +0000 |
| commit | 55a46f2c44c043c28ffb6d673906c940bb47bfa5 (patch) | |
| tree | 8cb10314f8a5328a22c079474f9792c1c4f43b05 /libexec | |
| parent | 70f813217a2aabab87cf29c09e46b1e6267db05e (diff) | |
Changes for using XIDLE option.
Diffstat (limited to 'libexec')
| -rw-r--r-- | libexec/rpc.rusersd/rusers_proc.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/libexec/rpc.rusersd/rusers_proc.c b/libexec/rpc.rusersd/rusers_proc.c index cb15cb6c591..8767bca6a19 100644 --- a/libexec/rpc.rusersd/rusers_proc.c +++ b/libexec/rpc.rusersd/rusers_proc.c @@ -42,6 +42,7 @@ #include <sys/param.h> #include <sys/stat.h> #ifdef XIDLE +#include <setjmp.h> #include <X11/Xlib.h> #include <X11/extensions/xidle.h> #endif @@ -129,8 +130,8 @@ XqueryIdle(char *display) (void) signal (SIGALRM, SIG_DFL); (void) alarm ((unsigned) 0); - idleTime /= 1000; - return((idleTime + 30) / 60); + IdleTime /= 1000; + return((IdleTime + 30) / 60); } #endif @@ -140,16 +141,17 @@ getidle(char *tty, char *display) struct stat st; char devname[PATH_MAX]; time_t now; - u_long idle = 0; + u_long idle; /* * If this is an X terminal or console, then try the * XIdle extension */ #ifdef XIDLE - if (display && (idle = XqueryIdle(display)) >= 0) + if (display && *display && (idle = XqueryIdle(display)) >= 0) return(idle); #endif + idle = 0; if (*tty == 'X') { u_long kbd_idle, mouse_idle; kbd_idle = getidle("kbd", NULL); |
