o __P removal

o use new style prototypes and function definitions
o signal handlers need an argument.  Mark it unused.
This commit is contained in:
Warner Losh 2002-02-07 05:24:53 +00:00
parent af842d6b76
commit a174e5b13a
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=90336
7 changed files with 61 additions and 109 deletions

View File

@ -36,12 +36,12 @@ static const char rcsid[] =
#include <rpcsvc/rquota.h> #include <rpcsvc/rquota.h>
#include <arpa/inet.h> #include <arpa/inet.h>
void rquota_service __P((struct svc_req *request, SVCXPRT *transp)); void rquota_service(struct svc_req *request, SVCXPRT *transp);
void sendquota __P((struct svc_req *request, SVCXPRT *transp)); void sendquota(struct svc_req *request, SVCXPRT *transp);
void printerr_reply __P((SVCXPRT *transp)); void printerr_reply(SVCXPRT *transp);
void initfs __P((void)); void initfs(void);
int getfsquota __P((long id, char *path, struct dqblk *dqblk)); int getfsquota(long id, char *path, struct dqblk *dqblk);
int hasquota __P((struct fstab *fs, char **qfnamep)); int hasquota(struct fstab *fs, char **qfnamep);
/* /*
* structure containing informations about ufs filesystems * structure containing informations about ufs filesystems
@ -58,16 +58,14 @@ struct fs_stat *fs_begin = NULL;
int from_inetd = 1; int from_inetd = 1;
void void
cleanup() cleanup(int sig)
{ {
(void) pmap_unset(RQUOTAPROG, RQUOTAVERS); (void) pmap_unset(RQUOTAPROG, RQUOTAVERS);
exit(0); exit(0);
} }
int int
main(argc, argv) main(int argc, char *argv[])
int argc;
char *argv[];
{ {
SVCXPRT *transp; SVCXPRT *transp;
int sock = 0; int sock = 0;
@ -112,9 +110,7 @@ main(argc, argv)
} }
void void
rquota_service(request, transp) rquota_service(struct svc_req *request, SVCXPRT *transp)
struct svc_req *request;
SVCXPRT *transp;
{ {
switch (request->rq_proc) { switch (request->rq_proc) {
case NULLPROC: case NULLPROC:
@ -136,9 +132,7 @@ rquota_service(request, transp)
/* read quota for the specified id, and send it */ /* read quota for the specified id, and send it */
void void
sendquota(request, transp) sendquota(struct svc_req *request, SVCXPRT *transp)
struct svc_req *request;
SVCXPRT *transp;
{ {
struct getquota_args getq_args; struct getquota_args getq_args;
struct getquota_rslt getq_rslt; struct getquota_rslt getq_rslt;
@ -188,8 +182,7 @@ sendquota(request, transp)
} }
void void
printerr_reply(transp) /* when a reply to a request failed */ printerr_reply(SVCXPRT *transp) /* when a reply to a request failed */
SVCXPRT *transp;
{ {
char *name; char *name;
struct sockaddr_in *caller; 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 */ /* initialise the fs_tab list from entries in /etc/fstab */
void void
initfs() initfs(void)
{ {
struct fs_stat *fs_current = NULL; struct fs_stat *fs_current = NULL;
struct fs_stat *fs_next = NULL; struct fs_stat *fs_next = NULL;
@ -246,10 +239,7 @@ initfs()
* Return 0 if fail, 1 otherwise * Return 0 if fail, 1 otherwise
*/ */
int int
getfsquota(id, path, dqblk) getfsquota(long id, char *path, struct dqblk *dqblk)
long id;
char *path;
struct dqblk *dqblk;
{ {
struct stat st_path; struct stat st_path;
struct fs_stat *fs; struct fs_stat *fs;
@ -304,9 +294,7 @@ getfsquota(id, path, dqblk)
* Comes from quota.c, NetBSD 0.9 * Comes from quota.c, NetBSD 0.9
*/ */
int int
hasquota(fs, qfnamep) hasquota(struct fstab *fs, char **qfnamep)
struct fstab *fs;
char **qfnamep;
{ {
static char initname, usrname[100]; static char initname, usrname[100];
static char buf[BUFSIZ]; static char buf[BUFSIZ];

View File

@ -83,10 +83,10 @@ struct nlist nl[] = {
{ "" }, { "" },
}; };
int havedisk __P((void)); int havedisk(void);
void updatexfers __P((int, int *)); void updatexfers(int, int *);
void setup __P((void)); void setup(void);
int stats_service(); int stats_service(void);
extern int from_inetd; extern int from_inetd;
int sincelastreq = 0; /* number of alarms since last request */ int sincelastreq = 0; /* number of alarms since last request */
@ -112,7 +112,7 @@ static long bsd_cp_time[CPUSTATES];
#endif #endif
void void
stat_init() stat_init(void)
{ {
stat_is_init = 1; stat_is_init = 1;
setup(); setup();
@ -123,9 +123,7 @@ stat_init()
} }
statstime * statstime *
rstatproc_stats_3_svc(argp, rqstp) rstatproc_stats_3_svc(void *argp, struct svc_req *rqstp)
void *argp;
struct svc_req *rqstp;
{ {
if (! stat_is_init) if (! stat_is_init)
stat_init(); stat_init();
@ -134,9 +132,7 @@ rstatproc_stats_3_svc(argp, rqstp)
} }
statsswtch * statsswtch *
rstatproc_stats_2_svc(argp, rqstp) rstatproc_stats_2_svc(void *argp, struct svc_req *rqstp)
void *argp;
struct svc_req *rqstp;
{ {
if (! stat_is_init) if (! stat_is_init)
stat_init(); stat_init();
@ -145,9 +141,7 @@ rstatproc_stats_2_svc(argp, rqstp)
} }
stats * stats *
rstatproc_stats_1_svc(argp, rqstp) rstatproc_stats_1_svc(void *argp, struct svc_req *rqstp)
void *argp;
struct svc_req *rqstp;
{ {
if (! stat_is_init) if (! stat_is_init)
stat_init(); stat_init();
@ -156,9 +150,7 @@ rstatproc_stats_1_svc(argp, rqstp)
} }
u_int * u_int *
rstatproc_havedisk_3_svc(argp, rqstp) rstatproc_havedisk_3_svc(void *argp, struct svc_req *rqstp)
void *argp;
struct svc_req *rqstp;
{ {
static u_int have; static u_int have;
@ -170,23 +162,19 @@ rstatproc_havedisk_3_svc(argp, rqstp)
} }
u_int * u_int *
rstatproc_havedisk_2_svc(argp, rqstp) rstatproc_havedisk_2_svc(void *argp, struct svc_req *rqstp)
void *argp;
struct svc_req *rqstp;
{ {
return(rstatproc_havedisk_3_svc(argp, rqstp)); return(rstatproc_havedisk_3_svc(argp, rqstp));
} }
u_int * u_int *
rstatproc_havedisk_1_svc(argp, rqstp) rstatproc_havedisk_1_svc(void *argp, struct svc_req *rqstp)
void *argp;
struct svc_req *rqstp;
{ {
return(rstatproc_havedisk_3_svc(argp, rqstp)); return(rstatproc_havedisk_3_svc(argp, rqstp));
} }
void void
updatestat() updatestat(void)
{ {
int i, hz; int i, hz;
struct clockinfo clockrate; struct clockinfo clockrate;
@ -336,7 +324,7 @@ setup()
* returns true if have a disk * returns true if have a disk
*/ */
int int
havedisk() havedisk(void)
{ {
register int i; register int i;
struct statinfo stats; struct statinfo stats;
@ -379,8 +367,7 @@ havedisk()
} }
void void
updatexfers(numdevs, devs) updatexfers(int numdevs, int *devs)
int numdevs, *devs;
{ {
register int i, j, t; register int i, j, t;
struct statinfo stats; struct statinfo stats;
@ -440,9 +427,7 @@ updatexfers(numdevs, devs)
} }
void void
rstat_service(rqstp, transp) rstat_service(struct svc_req *rqstp, SVCXPRT *transp)
struct svc_req *rqstp;
SVCXPRT *transp;
{ {
union { union {
int fill; int fill;

View File

@ -43,13 +43,13 @@ static const char rcsid[] =
#include <rpc/pmap_clnt.h> #include <rpc/pmap_clnt.h>
#include <rpcsvc/rstat.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 from_inetd = 1; /* started from inetd ? */
int closedown = 20; /* how long to wait before going dormant */ int closedown = 20; /* how long to wait before going dormant */
void void
cleanup() cleanup(int sig __unused)
{ {
(void) pmap_unset(RSTATPROG, RSTATVERS_TIME); (void) pmap_unset(RSTATPROG, RSTATVERS_TIME);
(void) pmap_unset(RSTATPROG, RSTATVERS_SWTCH); (void) pmap_unset(RSTATPROG, RSTATVERS_SWTCH);
@ -58,9 +58,7 @@ cleanup()
} }
int int
main(argc, argv) main(int argc, char *argv[])
int argc;
char *argv[];
{ {
SVCXPRT *transp; SVCXPRT *transp;
int sock = 0; int sock = 0;

View File

@ -98,7 +98,7 @@ Display *dpy;
static jmp_buf openAbort; static jmp_buf openAbort;
static void static void
abortOpen () abortOpen(void)
{ {
longjmp (openAbort, 1); longjmp (openAbort, 1);
} }
@ -237,7 +237,7 @@ do_names_2(int all)
} }
int * int *
rusers_num() rusers_num(void)
{ {
static int num_users = 0; static int num_users = 0;
struct utmp usr; struct utmp usr;
@ -287,41 +287,31 @@ do_names_1(int all)
} }
utmpidlearr * utmpidlearr *
rusersproc_names_2_svc(argp, rqstp) rusersproc_names_2_svc(void *argp, struct svc_req *rqstp)
void *argp;
struct svc_req *rqstp;
{ {
return(do_names_2(0)); return(do_names_2(0));
} }
utmpidlearr * utmpidlearr *
rusersproc_allnames_2_svc(argp, rqstp) rusersproc_allnames_2_svc(void *argp, struct svc_req *rqstp)
void *argp;
struct svc_req *rqstp;
{ {
return(do_names_2(1)); return(do_names_2(1));
} }
utmparr * utmparr *
rusersproc_names_1_svc(argp, rqstp) rusersproc_names_1_svc(void *argp, struct svc_req *rqstp)
void *argp;
struct svc_req *rqstp;
{ {
return(do_names_1(0)); return(do_names_1(0));
} }
utmparr * utmparr *
rusersproc_allnames_1_svc(argp, rqstp) rusersproc_allnames_1_svc(void *argp, struct svc_req *rqstp)
void *argp;
struct svc_req *rqstp;
{ {
return(do_names_1(1)); return(do_names_1(1));
} }
void void
rusers_service(rqstp, transp) rusers_service(struct svc_req *rqstp, SVCXPRT *transp)
struct svc_req *rqstp;
SVCXPRT *transp;
{ {
union { union {
int fill; int fill;

View File

@ -45,12 +45,12 @@ static const char rcsid[] =
#include <rpcsvc/rnusers.h> #include <rpcsvc/rnusers.h>
#undef utmp #undef utmp
extern void rusers_service(); extern void rusers_service(struct svc_req *, SVCXPRT *);
int from_inetd = 1; int from_inetd = 1;
void void
cleanup() cleanup(int sig __unused)
{ {
(void) pmap_unset(RUSERSPROG, RUSERSVERS_IDLE); (void) pmap_unset(RUSERSPROG, RUSERSVERS_IDLE);
(void) pmap_unset(RUSERSPROG, RUSERSVERS_ORIG); (void) pmap_unset(RUSERSPROG, RUSERSVERS_ORIG);
@ -58,9 +58,7 @@ cleanup()
} }
int int
main(argc, argv) main(int argc, char *argv[])
int argc;
char *argv[];
{ {
SVCXPRT *transp; SVCXPRT *transp;
int sock = 0; int sock = 0;

View File

@ -53,18 +53,16 @@ static const char rcsid[] =
#define WALL_CMD "/usr/bin/wall -n" #define WALL_CMD "/usr/bin/wall -n"
#endif #endif
void wallprog_1(); void wallprog_1(struct svc_req *rqstp, SVCXPRT *transp);
void possess(); void possess(void);
void killkids(); void killkids(int sig);
static void usage __P((void)); static void usage(void);
int nodaemon = 0; int nodaemon = 0;
int from_inetd = 1; int from_inetd = 1;
int int
main(argc, argv) main(int argc, char *argv[])
int argc;
char *argv[];
{ {
SVCXPRT *transp; SVCXPRT *transp;
int s, salen; int s, salen;
@ -135,26 +133,27 @@ main(argc, argv)
} }
static void static void
usage() usage(void)
{ {
fprintf(stderr, "usage: rpc.rwalld [-n]\n"); fprintf(stderr, "usage: rpc.rwalld [-n]\n");
exit(1); exit(1);
} }
void possess() void
possess(void)
{ {
daemon(0, 0); daemon(0, 0);
} }
void killkids() void
killkids(int sig)
{ {
while(wait4(-1, NULL, WNOHANG, NULL) > 0) while(wait4(-1, NULL, WNOHANG, NULL) > 0)
; ;
} }
void *wallproc_wall_1_svc(s, rqstp) void *
wrapstring *s; wallproc_wall_1_svc(wrapstring *s, struct svc_req *rqstp)
struct svc_req *rqstp;
{ {
static void *dummy = NULL; static void *dummy = NULL;
@ -173,9 +172,7 @@ void *wallproc_wall_1_svc(s, rqstp)
} }
void void
wallprog_1(rqstp, transp) wallprog_1(struct svc_req *rqstp, SVCXPRT *transp)
struct svc_req *rqstp;
SVCXPRT *transp;
{ {
union { union {
char *wallproc_wall_1_arg; char *wallproc_wall_1_arg;

View File

@ -44,7 +44,7 @@ static const char rcsid[] =
#include <syslog.h> #include <syslog.h>
#include <unistd.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; static int from_inetd = 1;
@ -61,22 +61,20 @@ static int from_inetd = 1;
#define TIMEOUT 120 #define TIMEOUT 120
void void
cleanup() cleanup(int sig __unused)
{ {
(void) pmap_unset(SPRAYPROG, SPRAYVERS); (void) pmap_unset(SPRAYPROG, SPRAYVERS);
exit(0); exit(0);
} }
void void
die() die(int sig __unused)
{ {
exit(0); exit(0);
} }
int int
main(argc, argv) main(int argc, char *argv[])
int argc;
char *argv[];
{ {
SVCXPRT *transp; SVCXPRT *transp;
int sock = 0; int sock = 0;
@ -128,9 +126,7 @@ main(argc, argv)
static void static void
spray_service(rqstp, transp) spray_service(struct svc_req *rqstp, SVCXPRT *transp)
struct svc_req *rqstp;
SVCXPRT *transp;
{ {
static spraycumul scum; static spraycumul scum;
static struct timeval clear, get; static struct timeval clear, get;