diff options
| author | christos <christos@NetBSD.org> | 1997-09-17 16:35:54 +0000 |
|---|---|---|
| committer | christos <christos@NetBSD.org> | 1997-09-17 16:35:54 +0000 |
| commit | 06f9c7876a01d4e5e7ad940c9ac84ec5aa7970ac (patch) | |
| tree | 6ee26cdf4d828da59c3b7e22f503c09206ab7346 /libexec | |
| parent | b65a5212c358fa3ab8d80aa419594fdcc502fbc2 (diff) | |
Fix WARNS problems. sigsetjmp() was missing an argument.
Diffstat (limited to 'libexec')
| -rw-r--r-- | libexec/rpc.rusersd/Makefile | 3 | ||||
| -rw-r--r-- | libexec/rpc.rusersd/rusers_proc.c | 60 | ||||
| -rw-r--r-- | libexec/rpc.rusersd/rusersd.c | 19 |
3 files changed, 57 insertions, 25 deletions
diff --git a/libexec/rpc.rusersd/Makefile b/libexec/rpc.rusersd/Makefile index fbf49cca029..ab438b329d8 100644 --- a/libexec/rpc.rusersd/Makefile +++ b/libexec/rpc.rusersd/Makefile @@ -1,5 +1,6 @@ -# $NetBSD: Makefile,v 1.13 1997/03/24 22:18:36 christos Exp $ +# $NetBSD: Makefile,v 1.14 1997/09/17 16:35:54 christos Exp $ +WARNS ?= 1 PROG = rpc.rusersd SRCS = rusersd.c rusers_proc.c MAN = rpc.rusersd.8 diff --git a/libexec/rpc.rusersd/rusers_proc.c b/libexec/rpc.rusersd/rusers_proc.c index 0b5fb21af1a..9f8f04a038a 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.13 1996/08/30 20:19:44 thorpej Exp $ */ +/* $NetBSD: rusers_proc.c,v 1.14 1997/09/17 16:35:55 christos Exp $ */ /*- * Copyright (c) 1993 John Brezak @@ -28,20 +28,29 @@ * POSSIBILITY OF SUCH DAMAGE. */ +#include <sys/cdefs.h> #ifndef lint -static char rcsid[] = "$NetBSD: rusers_proc.c,v 1.13 1996/08/30 20:19:44 thorpej Exp $"; +__RCSID("$NetBSD: rusers_proc.c,v 1.14 1997/09/17 16:35:55 christos Exp $"); #endif /* not lint */ +#include <stdio.h> +#include <string.h> +#include <stdlib.h> +#include <unistd.h> #include <signal.h> +#include <syslog.h> +#include <utmp.h> + #include <sys/types.h> #include <sys/time.h> -#include <utmp.h> -#include <stdio.h> -#include <syslog.h> -#include <rpc/rpc.h> #include <sys/socket.h> #include <sys/param.h> #include <sys/stat.h> + +#include <rpc/rpc.h> + +#include "rusers_proc.h" + #ifdef XIDLE #include <setjmp.h> #include <X11/Xlib.h> @@ -78,28 +87,41 @@ typedef char ut_line_t[UT_LINESIZE]; typedef char ut_name_t[UT_NAMESIZE]; typedef char ut_host_t[UT_HOSTSIZE]; -struct rusers_utmp utmps[MAXUSERS]; -struct utmpidle *utmp_idlep[MAXUSERS]; -struct utmpidle utmp_idle[MAXUSERS]; -ut_line_t line[MAXUSERS]; -ut_name_t name[MAXUSERS]; -ut_host_t host[MAXUSERS]; +static struct rusers_utmp utmps[MAXUSERS]; +static struct utmpidle *utmp_idlep[MAXUSERS]; +static struct utmpidle utmp_idle[MAXUSERS]; +static ut_line_t line[MAXUSERS]; +static ut_name_t name[MAXUSERS]; +static ut_host_t host[MAXUSERS]; extern int from_inetd; -FILE *ufp; +static u_int getidle __P((char *, char *)); +static int *rusers_num_svc __P((void *, struct svc_req *)); +static utmp_array *do_names_3 __P((int)); +static struct utmpidlearr *do_names_2 __P((int)); -#ifdef XIDLE -Display *dpy; +/* XXX */ +struct utmpidlearr *rusersproc_names_2_svc __P((void *, struct svc_req *)); +struct utmpidlearr *rusersproc_allnames_2_svc __P((void *, struct svc_req *)); + +#ifdef XIDLE +static FILE *ufp; +static Display *dpy; static sigjmp_buf openAbort; +static int XqueryIdle __P((char *)); +static void abortOpen __P((int)); + static void -abortOpen() +abortOpen(n) + int n; { siglongjmp(openAbort, 1); } +static int XqueryIdle(display) char *display; { @@ -108,7 +130,7 @@ XqueryIdle(display) (void) signal(SIGALRM, abortOpen); (void) alarm(10); - if (!sigsetjmp(openAbort)) { + if (!sigsetjmp(openAbort, 0)) { if ((dpy = XOpenDisplay(display)) == NULL) { syslog(LOG_ERR, "cannot open display %s", display); return (-1); @@ -186,7 +208,7 @@ getidle(tty, display) return (idle); } -int * +static int * rusers_num_svc(arg, rqstp) void *arg; struct svc_req *rqstp; @@ -223,7 +245,7 @@ do_names_3(int all) struct utmp usr; int nusers = 0; - bzero((char *)&ut, sizeof(ut)); + memset(&ut, 0, sizeof(ut)); ut.utmp_array_val = &utmps[0]; ufp = fopen(_PATH_UTMP, "r"); diff --git a/libexec/rpc.rusersd/rusersd.c b/libexec/rpc.rusersd/rusersd.c index ff1fb2808d9..cc73fc7495b 100644 --- a/libexec/rpc.rusersd/rusersd.c +++ b/libexec/rpc.rusersd/rusersd.c @@ -1,4 +1,4 @@ -/* $NetBSD: rusersd.c,v 1.9 1996/08/30 20:19:45 thorpej Exp $ */ +/* $NetBSD: rusersd.c,v 1.10 1997/09/17 16:35:56 christos Exp $ */ /*- * Copyright (c) 1993 John Brezak @@ -28,29 +28,38 @@ * POSSIBILITY OF SUCH DAMAGE. */ +#include <sys/cdefs.h> #ifndef lint -static char rcsid[] = "$NetBSD: rusersd.c,v 1.9 1996/08/30 20:19:45 thorpej Exp $"; +__RCSID("$NetBSD: rusersd.c,v 1.10 1997/09/17 16:35:56 christos Exp $"); #endif /* not lint */ #include <stdio.h> #include <rpc/rpc.h> +#include <sys/socket.h> #include <signal.h> #include <syslog.h> +#include <stdlib.h> #include <rpcsvc/rusers.h> /* New version */ #include <rpcsvc/rnusers.h> /* Old version */ -extern void rusers_service(); +#include "rusers_proc.h" + int from_inetd = 1; -void -cleanup() +static void cleanup __P((int)); +int main __P((int, char *[])); + +static void +cleanup(n) + int n; { (void) pmap_unset(RUSERSPROG, RUSERSVERS_3); (void) pmap_unset(RUSERSPROG, RUSERSVERS_IDLE); exit(0); } +int main(argc, argv) int argc; char *argv[]; |
