diff options
author | imp <imp@FreeBSD.org> | 2002-02-07 05:24:53 +0000 |
---|---|---|
committer | imp <imp@FreeBSD.org> | 2002-02-07 05:24:53 +0000 |
commit | e1bdd69900920a89472349782d7a69ee64542203 (patch) | |
tree | a97420fd8710100d2472e8ee31309885f50ca1a4 | |
parent | 905dfa59533e4633f63da9e029b55c43824f2abe (diff) | |
download | FreeBSD-src-e1bdd69900920a89472349782d7a69ee64542203.zip FreeBSD-src-e1bdd69900920a89472349782d7a69ee64542203.tar.gz |
o __P removal
o use new style prototypes and function definitions
o signal handlers need an argument. Mark it unused.
-rw-r--r-- | libexec/rpc.rquotad/rquotad.c | 40 | ||||
-rw-r--r-- | libexec/rpc.rstatd/rstat_proc.c | 45 | ||||
-rw-r--r-- | libexec/rpc.rstatd/rstatd.c | 8 | ||||
-rw-r--r-- | libexec/rpc.rusersd/rusers_proc.c | 26 | ||||
-rw-r--r-- | libexec/rpc.rusersd/rusersd.c | 8 | ||||
-rw-r--r-- | libexec/rpc.rwalld/rwalld.c | 29 | ||||
-rw-r--r-- | libexec/rpc.sprayd/sprayd.c | 14 |
7 files changed, 61 insertions, 109 deletions
diff --git a/libexec/rpc.rquotad/rquotad.c b/libexec/rpc.rquotad/rquotad.c index 8ec0e54..ea3fb2a 100644 --- a/libexec/rpc.rquotad/rquotad.c +++ b/libexec/rpc.rquotad/rquotad.c @@ -36,12 +36,12 @@ static const char rcsid[] = #include <rpcsvc/rquota.h> #include <arpa/inet.h> -void rquota_service __P((struct svc_req *request, SVCXPRT *transp)); -void sendquota __P((struct svc_req *request, SVCXPRT *transp)); -void printerr_reply __P((SVCXPRT *transp)); -void initfs __P((void)); -int getfsquota __P((long id, char *path, struct dqblk *dqblk)); -int hasquota __P((struct fstab *fs, char **qfnamep)); +void rquota_service(struct svc_req *request, SVCXPRT *transp); +void sendquota(struct svc_req *request, SVCXPRT *transp); +void printerr_reply(SVCXPRT *transp); +void initfs(void); +int getfsquota(long id, char *path, struct dqblk *dqblk); +int hasquota(struct fstab *fs, char **qfnamep); /* * structure containing informations about ufs filesystems @@ -58,16 +58,14 @@ struct fs_stat *fs_begin = NULL; int from_inetd = 1; void -cleanup() +cleanup(int sig) { (void) pmap_unset(RQUOTAPROG, RQUOTAVERS); exit(0); } int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char *argv[]) { SVCXPRT *transp; int sock = 0; @@ -112,9 +110,7 @@ main(argc, argv) } void -rquota_service(request, transp) - struct svc_req *request; - SVCXPRT *transp; +rquota_service(struct svc_req *request, SVCXPRT *transp) { switch (request->rq_proc) { case NULLPROC: @@ -136,9 +132,7 @@ rquota_service(request, transp) /* read quota for the specified id, and send it */ void -sendquota(request, transp) - struct svc_req *request; - SVCXPRT *transp; +sendquota(struct svc_req *request, SVCXPRT *transp) { struct getquota_args getq_args; struct getquota_rslt getq_rslt; @@ -188,8 +182,7 @@ sendquota(request, transp) } void -printerr_reply(transp) /* when a reply to a request failed */ - SVCXPRT *transp; +printerr_reply(SVCXPRT *transp) /* when a reply to a request failed */ { char *name; struct sockaddr_in *caller; @@ -208,7 +201,7 @@ printerr_reply(transp) /* when a reply to a request failed */ /* initialise the fs_tab list from entries in /etc/fstab */ void -initfs() +initfs(void) { struct fs_stat *fs_current = NULL; struct fs_stat *fs_next = NULL; @@ -246,10 +239,7 @@ initfs() * Return 0 if fail, 1 otherwise */ int -getfsquota(id, path, dqblk) - long id; - char *path; - struct dqblk *dqblk; +getfsquota(long id, char *path, struct dqblk *dqblk) { struct stat st_path; struct fs_stat *fs; @@ -304,9 +294,7 @@ getfsquota(id, path, dqblk) * Comes from quota.c, NetBSD 0.9 */ int -hasquota(fs, qfnamep) - struct fstab *fs; - char **qfnamep; +hasquota(struct fstab *fs, char **qfnamep) { static char initname, usrname[100]; static char buf[BUFSIZ]; diff --git a/libexec/rpc.rstatd/rstat_proc.c b/libexec/rpc.rstatd/rstat_proc.c index 2b63394..d1511a0 100644 --- a/libexec/rpc.rstatd/rstat_proc.c +++ b/libexec/rpc.rstatd/rstat_proc.c @@ -83,10 +83,10 @@ struct nlist nl[] = { { "" }, }; -int havedisk __P((void)); -void updatexfers __P((int, int *)); -void setup __P((void)); -int stats_service(); +int havedisk(void); +void updatexfers(int, int *); +void setup(void); +int stats_service(void); extern int from_inetd; int sincelastreq = 0; /* number of alarms since last request */ @@ -112,7 +112,7 @@ static long bsd_cp_time[CPUSTATES]; #endif void -stat_init() +stat_init(void) { stat_is_init = 1; setup(); @@ -123,9 +123,7 @@ stat_init() } statstime * -rstatproc_stats_3_svc(argp, rqstp) - void *argp; - struct svc_req *rqstp; +rstatproc_stats_3_svc(void *argp, struct svc_req *rqstp) { if (! stat_is_init) stat_init(); @@ -134,9 +132,7 @@ rstatproc_stats_3_svc(argp, rqstp) } statsswtch * -rstatproc_stats_2_svc(argp, rqstp) - void *argp; - struct svc_req *rqstp; +rstatproc_stats_2_svc(void *argp, struct svc_req *rqstp) { if (! stat_is_init) stat_init(); @@ -145,9 +141,7 @@ rstatproc_stats_2_svc(argp, rqstp) } stats * -rstatproc_stats_1_svc(argp, rqstp) - void *argp; - struct svc_req *rqstp; +rstatproc_stats_1_svc(void *argp, struct svc_req *rqstp) { if (! stat_is_init) stat_init(); @@ -156,9 +150,7 @@ rstatproc_stats_1_svc(argp, rqstp) } u_int * -rstatproc_havedisk_3_svc(argp, rqstp) - void *argp; - struct svc_req *rqstp; +rstatproc_havedisk_3_svc(void *argp, struct svc_req *rqstp) { static u_int have; @@ -170,23 +162,19 @@ rstatproc_havedisk_3_svc(argp, rqstp) } u_int * -rstatproc_havedisk_2_svc(argp, rqstp) - void *argp; - struct svc_req *rqstp; +rstatproc_havedisk_2_svc(void *argp, struct svc_req *rqstp) { return(rstatproc_havedisk_3_svc(argp, rqstp)); } u_int * -rstatproc_havedisk_1_svc(argp, rqstp) - void *argp; - struct svc_req *rqstp; +rstatproc_havedisk_1_svc(void *argp, struct svc_req *rqstp) { return(rstatproc_havedisk_3_svc(argp, rqstp)); } void -updatestat() +updatestat(void) { int i, hz; struct clockinfo clockrate; @@ -336,7 +324,7 @@ setup() * returns true if have a disk */ int -havedisk() +havedisk(void) { register int i; struct statinfo stats; @@ -379,8 +367,7 @@ havedisk() } void -updatexfers(numdevs, devs) - int numdevs, *devs; +updatexfers(int numdevs, int *devs) { register int i, j, t; struct statinfo stats; @@ -440,9 +427,7 @@ updatexfers(numdevs, devs) } void -rstat_service(rqstp, transp) - struct svc_req *rqstp; - SVCXPRT *transp; +rstat_service(struct svc_req *rqstp, SVCXPRT *transp) { union { int fill; diff --git a/libexec/rpc.rstatd/rstatd.c b/libexec/rpc.rstatd/rstatd.c index 21a0d56..35650d9 100644 --- a/libexec/rpc.rstatd/rstatd.c +++ b/libexec/rpc.rstatd/rstatd.c @@ -43,13 +43,13 @@ static const char rcsid[] = #include <rpc/pmap_clnt.h> #include <rpcsvc/rstat.h> -extern void rstat_service(); +extern void rstat_service(struct svc_req *, SVCXPRT *); int from_inetd = 1; /* started from inetd ? */ int closedown = 20; /* how long to wait before going dormant */ void -cleanup() +cleanup(int sig __unused) { (void) pmap_unset(RSTATPROG, RSTATVERS_TIME); (void) pmap_unset(RSTATPROG, RSTATVERS_SWTCH); @@ -58,9 +58,7 @@ cleanup() } int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char *argv[]) { SVCXPRT *transp; int sock = 0; diff --git a/libexec/rpc.rusersd/rusers_proc.c b/libexec/rpc.rusersd/rusers_proc.c index 4042217..69380c9 100644 --- a/libexec/rpc.rusersd/rusers_proc.c +++ b/libexec/rpc.rusersd/rusers_proc.c @@ -98,7 +98,7 @@ Display *dpy; static jmp_buf openAbort; static void -abortOpen () +abortOpen(void) { longjmp (openAbort, 1); } @@ -237,7 +237,7 @@ do_names_2(int all) } int * -rusers_num() +rusers_num(void) { static int num_users = 0; struct utmp usr; @@ -287,41 +287,31 @@ do_names_1(int all) } utmpidlearr * -rusersproc_names_2_svc(argp, rqstp) - void *argp; - struct svc_req *rqstp; +rusersproc_names_2_svc(void *argp, struct svc_req *rqstp) { return(do_names_2(0)); } utmpidlearr * -rusersproc_allnames_2_svc(argp, rqstp) - void *argp; - struct svc_req *rqstp; +rusersproc_allnames_2_svc(void *argp, struct svc_req *rqstp) { return(do_names_2(1)); } utmparr * -rusersproc_names_1_svc(argp, rqstp) - void *argp; - struct svc_req *rqstp; +rusersproc_names_1_svc(void *argp, struct svc_req *rqstp) { - return(do_names_1(0)); + return(do_names_1(0)); } utmparr * -rusersproc_allnames_1_svc(argp, rqstp) - void *argp; - struct svc_req *rqstp; +rusersproc_allnames_1_svc(void *argp, struct svc_req *rqstp) { return(do_names_1(1)); } void -rusers_service(rqstp, transp) - struct svc_req *rqstp; - SVCXPRT *transp; +rusers_service(struct svc_req *rqstp, SVCXPRT *transp) { union { int fill; diff --git a/libexec/rpc.rusersd/rusersd.c b/libexec/rpc.rusersd/rusersd.c index 9482692..fc4640f 100644 --- a/libexec/rpc.rusersd/rusersd.c +++ b/libexec/rpc.rusersd/rusersd.c @@ -45,12 +45,12 @@ static const char rcsid[] = #include <rpcsvc/rnusers.h> #undef utmp -extern void rusers_service(); +extern void rusers_service(struct svc_req *, SVCXPRT *); int from_inetd = 1; void -cleanup() +cleanup(int sig __unused) { (void) pmap_unset(RUSERSPROG, RUSERSVERS_IDLE); (void) pmap_unset(RUSERSPROG, RUSERSVERS_ORIG); @@ -58,9 +58,7 @@ cleanup() } int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char *argv[]) { SVCXPRT *transp; int sock = 0; diff --git a/libexec/rpc.rwalld/rwalld.c b/libexec/rpc.rwalld/rwalld.c index 985dca9..d352406 100644 --- a/libexec/rpc.rwalld/rwalld.c +++ b/libexec/rpc.rwalld/rwalld.c @@ -53,18 +53,16 @@ static const char rcsid[] = #define WALL_CMD "/usr/bin/wall -n" #endif -void wallprog_1(); -void possess(); -void killkids(); -static void usage __P((void)); +void wallprog_1(struct svc_req *rqstp, SVCXPRT *transp); +void possess(void); +void killkids(int sig); +static void usage(void); int nodaemon = 0; int from_inetd = 1; int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char *argv[]) { SVCXPRT *transp; int s, salen; @@ -135,26 +133,27 @@ main(argc, argv) } static void -usage() +usage(void) { fprintf(stderr, "usage: rpc.rwalld [-n]\n"); exit(1); } -void possess() +void +possess(void) { daemon(0, 0); } -void killkids() +void +killkids(int sig) { while(wait4(-1, NULL, WNOHANG, NULL) > 0) ; } -void *wallproc_wall_1_svc(s, rqstp) - wrapstring *s; - struct svc_req *rqstp; +void * +wallproc_wall_1_svc(wrapstring *s, struct svc_req *rqstp) { static void *dummy = NULL; @@ -173,9 +172,7 @@ void *wallproc_wall_1_svc(s, rqstp) } void -wallprog_1(rqstp, transp) - struct svc_req *rqstp; - SVCXPRT *transp; +wallprog_1(struct svc_req *rqstp, SVCXPRT *transp) { union { char *wallproc_wall_1_arg; diff --git a/libexec/rpc.sprayd/sprayd.c b/libexec/rpc.sprayd/sprayd.c index a6324e8..38d2135 100644 --- a/libexec/rpc.sprayd/sprayd.c +++ b/libexec/rpc.sprayd/sprayd.c @@ -44,7 +44,7 @@ static const char rcsid[] = #include <syslog.h> #include <unistd.h> -static void spray_service __P((struct svc_req *, SVCXPRT *)); +static void spray_service(struct svc_req *, SVCXPRT *); static int from_inetd = 1; @@ -61,22 +61,20 @@ static int from_inetd = 1; #define TIMEOUT 120 void -cleanup() +cleanup(int sig __unused) { (void) pmap_unset(SPRAYPROG, SPRAYVERS); exit(0); } void -die() +die(int sig __unused) { exit(0); } int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char *argv[]) { SVCXPRT *transp; int sock = 0; @@ -128,9 +126,7 @@ main(argc, argv) static void -spray_service(rqstp, transp) - struct svc_req *rqstp; - SVCXPRT *transp; +spray_service(struct svc_req *rqstp, SVCXPRT *transp) { static spraycumul scum; static struct timeval clear, get; |