diff options
author | des <des@FreeBSD.org> | 2002-02-06 15:26:07 +0000 |
---|---|---|
committer | des <des@FreeBSD.org> | 2002-02-06 15:26:07 +0000 |
commit | d7b064e238d98e1c9942cfb6e53c0767893310b1 (patch) | |
tree | 9c2a46d61c0b1ec2538854e870b6861acfd2ee7a /usr.sbin/rpc.ypupdated | |
parent | 0f2cb9b020b907000a28323fc57a82fdb7d6626d (diff) | |
download | FreeBSD-src-d7b064e238d98e1c9942cfb6e53c0767893310b1.zip FreeBSD-src-d7b064e238d98e1c9942cfb6e53c0767893310b1.tar.gz |
ANSIfy and remove some dead code.
Sponsored by: DARPA, NAI Labs
Diffstat (limited to 'usr.sbin/rpc.ypupdated')
-rw-r--r-- | usr.sbin/rpc.ypupdated/update.c | 54 | ||||
-rw-r--r-- | usr.sbin/rpc.ypupdated/yp_dbdelete.c | 5 | ||||
-rw-r--r-- | usr.sbin/rpc.ypupdated/yp_dbupdate.c | 16 | ||||
-rw-r--r-- | usr.sbin/rpc.ypupdated/ypupdated_main.c | 17 | ||||
-rw-r--r-- | usr.sbin/rpc.ypupdated/ypupdated_server.c | 24 |
5 files changed, 36 insertions, 80 deletions
diff --git a/usr.sbin/rpc.ypupdated/update.c b/usr.sbin/rpc.ypupdated/update.c index 6566f46..5cc0d7a 100644 --- a/usr.sbin/rpc.ypupdated/update.c +++ b/usr.sbin/rpc.ypupdated/update.c @@ -85,14 +85,9 @@ static int _openchild(char *, FILE **, FILE **); * and update it if so. Returns the yp status, which is zero * if there is no access violation. */ -mapupdate(requester, mapname, op, keylen, key, datalen, data) - char *requester; - char *mapname; - u_int op; - u_int keylen; - char *key; - u_int datalen; - char *data; +int +mapupdate(char *requester, char *mapname, u_int op, u_int keylen, char *key, + u_int datalen, char *data) { char updater[MAXMAPNAMELEN + 40]; FILE *childargs; @@ -137,23 +132,19 @@ mapupdate(requester, mapname, op, keylen, key, datalen, data) (void)wait(&status); #ifdef WEXITSTATUS - if (WEXITSTATUS(status) != 0) { + if (WEXITSTATUS(status) != 0) #else - if (status.w_retcode != 0) { + if (status.w_retcode != 0) #endif return (YPERR_YPERR); - } return (yperrno); } /* * returns pid, or -1 for failure */ -static -_openchild(command, fto, ffrom) - char *command; - FILE **fto; - FILE **ffrom; +static int +_openchild(char *command, FILE **fto, FILE **ffrom) { int i; pid_t pid; @@ -168,11 +159,7 @@ _openchild(command, fto, ffrom) if (pipe(pdfrom) < 0) { goto error2; } -#ifdef VFORK - switch (pid = vfork()) { -#else switch (pid = fork()) { -#endif case -1: goto error3; @@ -222,8 +209,7 @@ error1: } static char * -basename(path) - char *path; +basename(char *path) { char *p; @@ -237,16 +223,6 @@ basename(path) #else /* YP */ -#ifdef foo -#define ERR_ACCESS 1 -#define ERR_MALLOC 2 -#define ERR_READ 3 -#define ERR_WRITE 4 -#define ERR_DBASE 5 -#define ERR_KEY 6 -extern char *malloc(); -#endif - static int match(char *, char *); /* @@ -256,14 +232,8 @@ static int match(char *, char *); * the local file and then shuts up. */ int -localupdate(name, filename, op, keylen, key, datalen, data) - char *name; /* Name of the requestor */ - char *filename; - u_int op; - u_int keylen; /* Not used */ - char *key; - u_int datalen; /* Not used */ - char *data; +localupdate(char *name, char *filename, u_int op, u_int keylen __unused, + char *key, u_int datalen __unused, char *data) { char line[256]; FILE *rf; @@ -349,9 +319,7 @@ localupdate(name, filename, op, keylen, key, datalen, data) } static int -match(line, name) - char *line; - char *name; +match(char *line, char *name) { int len; diff --git a/usr.sbin/rpc.ypupdated/yp_dbdelete.c b/usr.sbin/rpc.ypupdated/yp_dbdelete.c index 8a97b19..d38e2be 100644 --- a/usr.sbin/rpc.ypupdated/yp_dbdelete.c +++ b/usr.sbin/rpc.ypupdated/yp_dbdelete.c @@ -48,9 +48,8 @@ static const char rcsid[] = #include <rpcsvc/yp.h> #include "ypxfr_extern.h" -int yp_del_record(dbp,key) - DB *dbp; - DBT *key; +int +yp_del_record(DB *dbp, DBT *key) { int rval; diff --git a/usr.sbin/rpc.ypupdated/yp_dbupdate.c b/usr.sbin/rpc.ypupdated/yp_dbupdate.c index b94b4b7..44b2b9c 100644 --- a/usr.sbin/rpc.ypupdated/yp_dbupdate.c +++ b/usr.sbin/rpc.ypupdated/yp_dbupdate.c @@ -49,9 +49,8 @@ struct dom_binding {}; #include "ypxfr_extern.h" #include "ypupdated_extern.h" -static int yp_domake(map, domain) - char *map; - char *domain; +static int +yp_domake(char *map, char *domain) { int pid; @@ -74,14 +73,9 @@ static int yp_domake(map, domain) return(0); } -int ypmap_update(netname, map, op, keylen, keyval, datlen, datval) - char *netname; - char *map; - unsigned int op; - unsigned int keylen; - char *keyval; - unsigned int datlen; - char *datval; +int +ypmap_update(char *netname, char *map, unsigned int op, unsigned int keylen, + char *keyval, unsigned int datlen, char *datval) { DB *dbp; DBT key = { NULL, 0 }, data = { NULL, 0 }; diff --git a/usr.sbin/rpc.ypupdated/ypupdated_main.c b/usr.sbin/rpc.ypupdated/ypupdated_main.c index 85cd7bf..64302ab 100644 --- a/usr.sbin/rpc.ypupdated/ypupdated_main.c +++ b/usr.sbin/rpc.ypupdated/ypupdated_main.c @@ -79,8 +79,8 @@ extern int _rpcsvcstate; /* Set when a request is serviced */ char *progname = "rpc.ypupdated"; char *yp_dir = "/var/yp/"; -static -void _msgout(char* msg) +static void +_msgout(char* msg) { #ifdef RPC_SVC_FG if (_rpcpmstart) @@ -119,7 +119,7 @@ closedown(int sig) } static void -ypupdated_svc_run() +ypupdated_svc_run(void) { #ifdef FD_SETSIZE fd_set readfds; @@ -157,8 +157,8 @@ ypupdated_svc_run() } } -static void reaper(sig) - int sig; +static void +reaper(int sig) { int status; @@ -178,16 +178,15 @@ static void reaper(sig) } } -void usage() +void +usage(void) { fprintf(stderr, "rpc.ypupdatedd [-p path]\n"); exit(0); } int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char *argv[]) { register SVCXPRT *transp = NULL; int sock; diff --git a/usr.sbin/rpc.ypupdated/ypupdated_server.c b/usr.sbin/rpc.ypupdated/ypupdated_server.c index 08f9f56..fb1017d 100644 --- a/usr.sbin/rpc.ypupdated/ypupdated_server.c +++ b/usr.sbin/rpc.ypupdated/ypupdated_server.c @@ -66,8 +66,8 @@ int forked = 0; #define WINDOW (60*60) #endif -static enum auth_stat yp_checkauth(svcreq) - struct svc_req *svcreq; +static enum auth_stat +yp_checkauth(struct svc_req *svcreq) { struct authdes_cred *des_cred; @@ -93,9 +93,8 @@ was too large -- possible spoof attempt"); } } -unsigned int *ypu_change_1_svc(args, svcreq) - struct ypupdate_args *args; - struct svc_req *svcreq; +unsigned int * +ypu_change_1_svc(struct ypupdate_args *args, struct svc_req *svcreq) { struct authdes_cred *des_cred; static int res; @@ -128,9 +127,8 @@ unsigned int *ypu_change_1_svc(args, svcreq) return (&res); } -unsigned int *ypu_insert_1_svc(args, svcreq) - struct ypupdate_args *args; - struct svc_req *svcreq; +unsigned int * +ypu_insert_1_svc(struct ypupdate_args *args, struct svc_req *svcreq) { struct authdes_cred *des_cred; static int res; @@ -163,9 +161,8 @@ unsigned int *ypu_insert_1_svc(args, svcreq) return (&res); } -unsigned int *ypu_delete_1_svc(args, svcreq) - struct ypdelete_args *args; - struct svc_req *svcreq; +unsigned int * +ypu_delete_1_svc(struct ypdelete_args *args, struct svc_req *svcreq) { struct authdes_cred *des_cred; static int res; @@ -198,9 +195,8 @@ unsigned int *ypu_delete_1_svc(args, svcreq) return (&res); } -unsigned int *ypu_store_1_svc(args, svcreq) - struct ypupdate_args *args; - struct svc_req *svcreq; +unsigned int * +ypu_store_1_svc(struct ypupdate_args *args, struct svc_req *svcreq) { struct authdes_cred *des_cred; static int res; |