From 49075b24c23b50aa0d318b6cb65f7bd01d4f6893 Mon Sep 17 00:00:00 2001 From: Peter Valchev Date: Thu, 18 Jul 2002 00:50:24 +0000 Subject: ANSIfy; ok deraadt --- usr.sbin/amd/amd/amd.c | 15 ++---- usr.sbin/amd/amd/info_file.c | 46 +++-------------- usr.sbin/amd/amd/info_hes.c | 66 ++++++------------------ usr.sbin/amd/amd/info_ndbm.c | 21 ++------ usr.sbin/amd/amd/info_nis.c | 30 +++-------- usr.sbin/amd/amd/info_passwd.c | 15 ++---- usr.sbin/amd/amd/info_union.c | 21 ++------ usr.sbin/amd/amd/nfs_ops.c | 74 +++++++------------------- usr.sbin/amd/amd/nfs_start.c | 17 +++--- usr.sbin/amd/amd/nfs_subr.c | 114 +++++++++++------------------------------ 10 files changed, 101 insertions(+), 318 deletions(-) (limited to 'usr.sbin/amd') diff --git a/usr.sbin/amd/amd/amd.c b/usr.sbin/amd/amd/amd.c index da1469040e2..076495c86d9 100644 --- a/usr.sbin/amd/amd/amd.c +++ b/usr.sbin/amd/amd/amd.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * from: @(#)amd.c 8.1 (Berkeley) 6/6/93 - * $Id: amd.c,v 1.8 2002/06/23 03:07:18 deraadt Exp $ + * $Id: amd.c,v 1.9 2002/07/18 00:50:23 pvalchev Exp $ */ #ifndef lint @@ -91,8 +91,7 @@ int orig_umask; * SIGINT - tells amd to do a full shutdown, including unmounting all filesystem. * SIGTERM - tells amd to shutdown now. Just unmounts the automount nodes. */ -static void sigterm(sig) -int sig; +static void sigterm(int sig) { #ifdef SYS5_SIGNALS signal(sig, sigterm); @@ -120,8 +119,7 @@ int sig; * When a SIGHUP arrives it schedules a call to mapc_reload */ /*ARGSUSED*/ -static void sighup(sig) -int sig; +static void sighup(int sig) { #ifdef SYS5_SIGNALS signal(sig, sighup); @@ -139,8 +137,7 @@ int sig; } /*ARGSUSED*/ -static void parent_exit(sig) -int sig; +static void parent_exit(int sig) { exit(0); } @@ -192,9 +189,7 @@ static pid_t daemon_mode(P_void) } int -main(argc, argv) -int argc; -char *argv[]; +main(int argc, char *argv[]) { char *domdot; pid_t ppid = 0; diff --git a/usr.sbin/amd/amd/info_file.c b/usr.sbin/amd/amd/info_file.c index d0a2aa62087..431e9f8103d 100644 --- a/usr.sbin/amd/amd/info_file.c +++ b/usr.sbin/amd/amd/info_file.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * from: @(#)info_file.c 8.1 (Berkeley) 6/6/93 - * $Id: info_file.c,v 1.1 1995/10/18 08:47:10 deraadt Exp $ + * $Id: info_file.c,v 1.2 2002/07/18 00:50:23 pvalchev Exp $ */ /* @@ -51,11 +51,7 @@ #define MAX_LINE_LEN 2048 -static int read_line P((char *buf, int size, FILE *fp)); -static int read_line(buf, size, fp) -char *buf; -int size; -FILE *fp; +static int read_line(char *buf, int size, FILE *fp) { int done = 0; @@ -88,14 +84,7 @@ FILE *fp; /* * Try to locate a key in a file */ -static int search_or_reload_file P((FILE *fp, char *map, char *key, char **val, mnt_map *m, void (*fn)(mnt_map *m, char*, char*))); -static int search_or_reload_file(fp, map, key, val, m, fn) -FILE *fp; -char *map; -char *key; -char **val; -mnt_map *m; -void (*fn) P((mnt_map*, char*, char*)); +static int search_or_reload_file(FILE *fp, char *map, char *key, char **val, mnt_map *m, void (*fn)(mnt_map *m, char*, char*)) { char key_val[MAX_LINE_LEN]; int chuck = 0; @@ -188,10 +177,7 @@ again: return fn ? 0 : ENOENT; } -static FILE *file_open P((char *map, time_t *tp)); -static FILE *file_open(map, tp) -char *map; -time_t *tp; +static FILE *file_open(char *map, time_t *tp) { FILE *mapf = fopen(map, "r"); if (mapf && tp) { @@ -204,10 +190,7 @@ time_t *tp; return mapf; } -int file_init P((char *map, time_t *tp)); -int file_init(map, tp) -char *map; -time_t *tp; +int file_init(char *map, time_t *tp) { FILE *mapf = file_open(map, tp); if (mapf) { @@ -217,11 +200,7 @@ time_t *tp; return errno; } -int file_reload P((mnt_map *m, char *map, void (*fn)())); -int file_reload(m, map, fn) -mnt_map *m; -char *map; -void (*fn)(); +int file_reload(mnt_map *m, char *map, void (*fn)()) { FILE *mapf = file_open(map, (time_t *) 0); if (mapf) { @@ -233,13 +212,7 @@ void (*fn)(); return errno; } -int file_search P((mnt_map *m, char *map, char *key, char **pval, time_t *tp)); -int file_search(m, map, key, pval, tp) -mnt_map *m; -char *map; -char *key; -char **pval; -time_t *tp; +int file_search(mnt_map *m, char *map, char *key, char **pval, time_t *tp) { time_t t; FILE *mapf = file_open(map, &t); @@ -258,10 +231,7 @@ time_t *tp; return errno; } -int file_mtime P((char *map, time_t *tp)); -int file_mtime(map, tp) -char *map; -time_t *tp; +int file_mtime(char *map, time_t *tp) { FILE *mapf = file_open(map, tp); if (mapf) { diff --git a/usr.sbin/amd/amd/info_hes.c b/usr.sbin/amd/amd/info_hes.c index 28363b8aa4e..6905b8535df 100644 --- a/usr.sbin/amd/amd/info_hes.c +++ b/usr.sbin/amd/amd/info_hes.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * from: @(#)info_hes.c 8.1 (Berkeley) 6/6/93 - * $Id: info_hes.c,v 1.7 2002/06/11 05:29:54 itojun Exp $ + * $Id: info_hes.c,v 1.8 2002/07/18 00:50:23 pvalchev Exp $ */ /* @@ -77,10 +77,7 @@ static int servernum; /* * No easy way to probe the server - check the map name begins with "hesiod." */ -int hesiod_init P((char *map, time_t *tp)); -int hesiod_init(map, tp) -char *map; -time_t *tp; +int hesiod_init(char *map, time_t *tp) { #ifdef DEBUG dlog("hesiod_init(%s)", map); @@ -105,13 +102,7 @@ time_t *tp; * Do a Hesiod nameserver call. * Modify time is ignored by Hesiod - XXX */ -int hesiod_search P((mnt_map *m, char *map, char **pval, time_t *tp)); -int hesiod_search(m, map, key, pval, tp) -mnt_map *m; -char *map; -char *key; -char **pval; -time_t *tp; +int hesiod_search(mnt_map *m, char *map, char **pval, time_t *tp) { int error; char hes_key[MAXPATHLEN]; @@ -175,11 +166,7 @@ static mnt_map *hs_map; static int hs_nscount; static char nsaddr_list[MAX_NSADDR][sizeof(struct in_addr)]; -int hesiod_reload P((mnt_map *m, char *map, void (*fn)())); -int hesiod_reload(m, map, fn) -mnt_map *m; -char *map; -void (*fn)(); +int hesiod_reload(mnt_map *m, char *map, void (*fn)()) { char *zone_name, *cp; short domainlen; @@ -222,8 +209,7 @@ void (*fn)(); return(-1); } -hs_zone_transfer(domain) -char *domain; +hs_zone_transfer(char *domain) { int status, len; char buf[PACKETSZ]; @@ -254,11 +240,7 @@ char *domain; #define hs_server_addr(ns) ((struct in_addr *) nsaddr_list[ns]) -hs_res_send(buf, buflen, answer, anslen) -char *buf; -int buflen; -char *answer; -int anslen; +hs_res_send(char *buf, int buflen, char *answer, int anslen) { int retry, ns; u_short id, len; @@ -345,10 +327,7 @@ int anslen; -1: Error -2: Permanent failure */ -hs_readresp(s, answer, anslen) -int s; -char *answer; -int anslen; +hs_readresp(int s, char *answer, int anslen) { register int len, n; char *cp; @@ -379,10 +358,7 @@ int anslen; return(hs_parse(answer, answer+PACKETSZ)); } -hs_res_vcread(sock, buf, buflen, timeout) -int sock, buflen; -char *buf; -struct timeval *timeout; +hs_res_vcread(int sock, char *buf, int buflen, struct timeval *timeout) { register int n; @@ -392,9 +368,7 @@ struct timeval *timeout; return(n); } -hs_res_selwait(sock, timeout) -int sock; -struct timeval *timeout; +hs_res_selwait(int sock, struct timeval timeout) { fd_set *fdsp; int fdsn; @@ -420,8 +394,7 @@ struct timeval *timeout; -1: Error -2: Permanent failure */ -hs_parse(msg, eom) -char *msg, *eom; +hs_parse(char *msg, char *eom) { register char *cp; register HEADER *hp; @@ -481,8 +454,7 @@ char *msg, *eom; /* Check to see if the domain name in the supplied argument matches hs_domain. Strip hs_domain from supplied argument if so. */ -hs_strip_our_domain(name) -char *name; +hs_strip_our_domain(char *name) { char *end_pos; short targ_len, cur_len; @@ -502,10 +474,7 @@ char *name; #define MAXDATA 8*1024 -char * -hs_make_value(cp, len) -char *cp; -int len; +char *hs_make_value(chr *cp, int len) { char *value, *cpcpy, *valuep; int cnt, nextcnt, totalcnt, lencpy; @@ -553,9 +522,7 @@ int len; return(value); } -hs_make_ns_query(domain, ansbuf) -char *domain; -char *ansbuf; +hs_make_ns_query(char *domain, char *ansbuf) { int status, len; char buf[PACKETSZ]; @@ -579,9 +546,7 @@ char *ansbuf; return(0); } -static void -add_address(addr) -struct in_addr *addr; +static void add_address(struct in_addr *addr) { char dq[20]; bcopy((char *)addr, nsaddr_list[hs_nscount++], sizeof(struct in_addr)); @@ -590,8 +555,7 @@ struct in_addr *addr; #endif /* DEBUG */ } -hs_get_ns_list(domain) -char *domain; +hs_get_ns_list(char *domain) { register HEADER *hp; int qdcount, nscount; diff --git a/usr.sbin/amd/amd/info_ndbm.c b/usr.sbin/amd/amd/info_ndbm.c index d1933dbe4a5..ca5a6afb4f7 100644 --- a/usr.sbin/amd/amd/info_ndbm.c +++ b/usr.sbin/amd/amd/info_ndbm.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * from: @(#)info_ndbm.c 8.1 (Berkeley) 6/6/93 - * $Id: info_ndbm.c,v 1.1 1995/10/18 08:47:10 deraadt Exp $ + * $Id: info_ndbm.c,v 1.2 2002/07/18 00:50:23 pvalchev Exp $ */ /* @@ -51,11 +51,7 @@ #include #include -static int search_ndbm P((DBM *db, char *key, char **val)); -static int search_ndbm(db, key, val) -DBM *db; -char *key; -char **val; +static int search_ndbm(DBM *db, char *key, char **val) { datum k, v; k.dptr = key; @@ -68,13 +64,7 @@ char **val; return ENOENT; } -int ndbm_search P((mnt_map *m, char *map, char *key, char **pval, time_t *tp)); -int ndbm_search(m, map, key, pval, tp) -mnt_map *m; -char *map; -char *key; -char **pval; -time_t *tp; +int ndbm_search(mnt_map *m, char *map, char *key, char **pval, time_t *tp) { DBM *db; @@ -96,10 +86,7 @@ time_t *tp; return errno; } -int ndbm_init P((char *map, time_t *tp)); -int ndbm_init(map, tp) -char *map; -time_t *tp; +int ndbm_init(char *map, time_t *tp) { DBM *db; diff --git a/usr.sbin/amd/amd/info_nis.c b/usr.sbin/amd/amd/info_nis.c index 68212e9fcd4..fd128fdfdc4 100644 --- a/usr.sbin/amd/amd/info_nis.c +++ b/usr.sbin/amd/amd/info_nis.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * from: @(#)info_nis.c 8.1 (Berkeley) 6/6/93 - * $Id: info_nis.c,v 1.4 2001/03/02 06:22:02 deraadt Exp $ + * $Id: info_nis.c,v 1.5 2002/07/18 00:50:23 pvalchev Exp $ */ /* @@ -97,13 +97,8 @@ struct nis_callback_data { /* * Callback from yp_all */ -static int callback(status, key, kl, val, vl, data) -int status; -char *key; -int kl; -char *val; -int vl; -struct nis_callback_data *data; +static int callback(int status, char *key, int kl, char *val, + int vl, struct nis_callback_data *data) { if (status == YP_TRUE) { /* @@ -139,11 +134,7 @@ struct nis_callback_data *data; } } -int nis_reload P((mnt_map *m, char *map, void (*fn)())); -int nis_reload(m, map, fn) -mnt_map *m; -char *map; -void (*fn)(); +int nis_reload(mnt_map *m, char *map, void (*fn)()) { struct ypall_callback cbinfo; int error; @@ -173,13 +164,7 @@ void (*fn)(); /* * Try to locate a key using NIS. */ -int nis_search P((mnt_map *m, char *map, char *key, char **val, time_t *tp)); -int nis_search(m, map, key, val, tp) -mnt_map *m; -char *map; -char *key; -char **val; -time_t *tp; +int nis_search(mnt_map *m, char *map, char *key, char **val, time_t *tp) { int outlen; int res; @@ -252,10 +237,7 @@ time_t *tp; } } -int nis_init P((char *map, time_t *tp)); -int nis_init(map, tp) -char *map; -time_t *tp; +int nis_init(char *map, time_t *tp) { int order; int yp_order_result; diff --git a/usr.sbin/amd/amd/info_passwd.c b/usr.sbin/amd/amd/info_passwd.c index ae216afc4a2..a5e59edcbec 100644 --- a/usr.sbin/amd/amd/info_passwd.c +++ b/usr.sbin/amd/amd/info_passwd.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * from: @(#)info_passwd.c 8.1 (Berkeley) 6/6/93 - * $Id: info_passwd.c,v 1.3 2002/06/11 05:29:54 itojun Exp $ + * $Id: info_passwd.c,v 1.4 2002/07/18 00:50:23 pvalchev Exp $ */ /* @@ -56,10 +56,7 @@ /* * Nothing to probe - check the map name is PASSWD_MAP. */ -int passwd_init P((char *map, time_t *tp)); -int passwd_init(map, tp) -char *map; -time_t *tp; +int passwd_init(char *map, time_t *tp) { *tp = 0; return strcmp(map, PASSWD_MAP) == 0 ? 0 : ENOENT; @@ -70,13 +67,7 @@ time_t *tp; * Grab the entry via the getpwname routine * Modify time is ignored by passwd - XXX */ -int passwd_search P((mnt_map *m, char *map, char *key, char **pval, time_t *tp)); -int passwd_search(m, map, key, pval, tp) -mnt_map *m; -char *map; -char *key; -char **pval; -time_t *tp; +int passwd_search(mnt_map *m, char *map, char *key, char **pval, time_t *tp) { char *dir = 0; struct passwd *pw; diff --git a/usr.sbin/amd/amd/info_union.c b/usr.sbin/amd/amd/info_union.c index f06d19ad772..9a866ef50da 100644 --- a/usr.sbin/amd/amd/info_union.c +++ b/usr.sbin/amd/amd/info_union.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * from: @(#)info_union.c 8.1 (Berkeley) 6/6/93 - * $Id: info_union.c,v 1.3 2002/06/11 05:29:54 itojun Exp $ + * $Id: info_union.c,v 1.4 2002/07/18 00:50:23 pvalchev Exp $ */ /* @@ -64,22 +64,13 @@ /* * No way to probe - check the map name begins with "union:" */ -int union_init P((char *map, time_t *tp)); -int union_init(map, tp) -char *map; -time_t *tp; +int union_init(char *map, time_t *tp) { *tp = 0; return strncmp(map, UNION_PREFIX, UNION_PREFLEN) == 0 ? 0 : ENOENT; } -int union_search P((mnt_map *m, char *map, char *key, char **pval, time_t *tp)); -int union_search(m, map, key, pval, tp) -mnt_map *m; -char *map; -char *key; -char **pval; -time_t *tp; +int union_search(mnt_map *m, char *map, char *key, char **pval, time_t *tp) { char *mapd = strdup(map + UNION_PREFLEN); char **v = strsplit(mapd, ':', '\"'); @@ -93,11 +84,7 @@ time_t *tp; return 0; } -int union_reload P((mnt_map *m, char *map, void (*fn)())); -int union_reload(m, map, fn) -mnt_map *m; -char *map; -void (*fn)(); +int union_reload(mnt_map *m, char *map, void (*fn)()) { char *mapd = strdup(map + UNION_PREFLEN); char **v = strsplit(mapd, ':', '\"'); diff --git a/usr.sbin/amd/amd/nfs_ops.c b/usr.sbin/amd/amd/nfs_ops.c index e362a7657de..d10747fccf2 100644 --- a/usr.sbin/amd/amd/nfs_ops.c +++ b/usr.sbin/amd/amd/nfs_ops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nfs_ops.c,v 1.12 2002/06/11 05:29:54 itojun Exp $ */ +/* $OpenBSD: nfs_ops.c,v 1.13 2002/07/18 00:50:23 pvalchev Exp $ */ /*- * Copyright (c) 1990 Jan-Simon Pendry @@ -40,7 +40,7 @@ #ifndef lint /*static char sccsid[] = "from: @(#)nfs_ops.c 8.1 (Berkeley) 6/6/93";*/ -static char *rcsid = "$OpenBSD: nfs_ops.c,v 1.12 2002/06/11 05:29:54 itojun Exp $"; +static char *rcsid = "$OpenBSD: nfs_ops.c,v 1.13 2002/07/18 00:50:23 pvalchev Exp $"; #endif /* not lint */ #include "am.h" @@ -116,14 +116,11 @@ static int fh_id = 0; extern qelem fh_head; qelem fh_head = { &fh_head, &fh_head }; -static int call_mountd P((fh_cache*, unsigned long, fwd_fun, voidp)); +static int call_mountd(fh_cache*, unsigned long, fwd_fun, voidp); AUTH *nfs_auth; -static fh_cache *find_nfs_fhandle_cache P((voidp idv, int done)); -static fh_cache *find_nfs_fhandle_cache(idv, done) -voidp idv; -int done; +static fh_cache *find_nfs_fhandle_cache(voidp idv, int done) { fh_cache *fp, *fp2 = 0; /* XXX EVIL XXX */ @@ -155,14 +152,8 @@ int done; /* * Called when a filehandle appears */ -static void got_nfs_fh P((voidp pkt, int len, struct sockaddr_in *sa, - struct sockaddr_in *ia, voidp idv, int done)); -static void got_nfs_fh(pkt, len, sa, ia, idv, done) -voidp pkt; -int len; -struct sockaddr_in *sa, *ia; -voidp idv; -int done; +static void got_nfs_fh(voidp pkt, int len, struct sockaddr_in *sa, + struct sockaddr_in *ia, voidp idv, int done) { fh_cache *fp = find_nfs_fhandle_cache(idv, done); if (fp) { @@ -187,9 +178,7 @@ int done; } } -void flush_nfs_fhandle_cache P((fserver *fs)); -void flush_nfs_fhandle_cache(fs) -fserver *fs; +void flush_nfs_fhandle_cache(fserver *fs) { fh_cache *fp; ITER(fp, fh_cache, &fh_head) { @@ -200,9 +189,7 @@ fserver *fs; } } -static void discard_fh P((fh_cache *fp)); -static void discard_fh(fp) -fh_cache *fp; +static void discard_fh(fh_cache *fp) { rem_que(&fp->fh_q); #ifdef DEBUG @@ -216,12 +203,7 @@ fh_cache *fp; /* * Determine the file handle for a node */ -static int prime_nfs_fhandle_cache P((char *path, fserver *fs, fhstatus *fhbuf, voidp wchan)); -static int prime_nfs_fhandle_cache(path, fs, fhbuf, wchan) -char *path; -fserver *fs; -fhstatus *fhbuf; -voidp wchan; +static int prime_nfs_fhandle_cache(char *path, fserver *fs, fhstatus *fhbuf, voidp wchan) { fh_cache *fp, *fp_save = 0; int error; @@ -340,7 +322,7 @@ voidp wchan; return error; } -int make_nfs_auth P((void)) +int make_nfs_auth(void) { #ifdef HAS_NFS_QUALIFIED_NAMES /* @@ -359,12 +341,7 @@ int make_nfs_auth P((void)) return 0; } -static int call_mountd P((fh_cache *fp, u_long proc, fwd_fun f, voidp wchan)); -static int call_mountd(fp, proc, f, wchan) -fh_cache *fp; -u_long proc; -fwd_fun f; -voidp wchan; +static int call_mountd(fh_cache *fp, u_long proc, fwd_fun f, voidp wchan) { struct rpc_msg mnt_msg; int len; @@ -420,8 +397,7 @@ voidp wchan; * remote hostname. * Local filesystem defaults to remote and vice-versa. */ -static char *nfs_match(fo) -am_opts *fo; +static char *nfs_match(am_opts *fo) { char *xmtab; if (fo->opt_fs && !fo->opt_rfs) @@ -451,8 +427,7 @@ am_opts *fo; /* * Initialise am structure for nfs */ -static int nfs_init(mf) -mntfs *mf; +static int nfs_init(mntfs *mf) { if (!mf->mf_private) { int error; @@ -474,13 +449,7 @@ mntfs *mf; return 0; } -int mount_nfs_fh P((fhstatus *fhp, char *dir, char *fs_name, char *opts, mntfs *mf)); -int mount_nfs_fh(fhp, dir, fs_name, opts, mf) -fhstatus *fhp; -char *dir; -char *fs_name; -char *opts; -mntfs *mf; +int mount_nfs_fh(fhstatus *fhp, char *dir, char *fs_name, char *opts, mntfs *mf) { struct nfs_args nfs_args; struct mntent mnt; @@ -694,11 +663,7 @@ mntfs *mf; return error; } -static int mount_nfs(dir, fs_name, opts, mf) -char *dir; -char *fs_name; -char *opts; -mntfs *mf; +static int mount_nfs(char *dir, char *fs_name, char *opts, mntfs *mf) { #ifdef notdef int error; @@ -726,8 +691,7 @@ mntfs *mf; return mount_nfs_fh((fhstatus *) mf->mf_private, dir, fs_name, opts, mf); } -static int nfs_fmount(mf) -mntfs *mf; +static int nfs_fmount(mntfs *mf) { int error; @@ -742,8 +706,7 @@ mntfs *mf; return error; } -static int nfs_fumount(mf) -mntfs *mf; +static int nfs_fumount(mntfs *mf) { int error = UMOUNT_FS(mf->mf_mount); if (error) @@ -752,8 +715,7 @@ mntfs *mf; return 0; } -static void nfs_umounted(mp) -am_node *mp; +static void nfs_umounted(am_node *mp) { #ifdef INFORM_MOUNTD /* diff --git a/usr.sbin/amd/amd/nfs_start.c b/usr.sbin/amd/amd/nfs_start.c index 9f0bb1b2f33..44c72da8724 100644 --- a/usr.sbin/amd/amd/nfs_start.c +++ b/usr.sbin/amd/amd/nfs_start.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * from: @(#)nfs_start.c 8.1 (Berkeley) 6/6/93 - * $Id: nfs_start.c,v 1.7 2002/05/26 02:49:50 deraadt Exp $ + * $Id: nfs_start.c,v 1.8 2002/07/18 00:50:23 pvalchev Exp $ */ #include "am.h" @@ -53,7 +53,7 @@ extern int select_intr_valid; * so that we do NFS gatewaying. */ #define svcudp_create svcudp2_create -extern SVCXPRT *svcudp2_create P((int)); +extern SVCXPRT *svcudp2_create(int); #endif /* HAS_TFS */ extern void nfs_program_2(); @@ -71,12 +71,11 @@ int max_fds = -1; */ static void checkup(P_void) { - -static int max_fd = 0; -static char *max_mem = 0; + static int max_fd = 0; + static char *max_mem = 0; int next_fd = dup(0); - extern caddr_t sbrk P((int)); + extern caddr_t sbrk(int); caddr_t next_mem = sbrk(0); close(next_fd); @@ -363,8 +362,7 @@ static serv_state run_rpc(P_void) return amd_state; } -static int bindnfs_port(so) -int so; +static int bindnfs_port(int so) { unsigned short port; int error = bind_resv_port(so, &port); @@ -381,8 +379,7 @@ void unregister_amq(P_void) (void) pmap_unset(AMQ_PROGRAM, AMQ_VERSION); } -int mount_automounter(ppid) -pid_t ppid; +int mount_automounter(pid_t ppid) { int so = socket(AF_INET, SOCK_DGRAM, 0); SVCXPRT *amqp; diff --git a/usr.sbin/amd/amd/nfs_subr.c b/usr.sbin/amd/amd/nfs_subr.c index f01b189c467..d5871524f53 100644 --- a/usr.sbin/amd/amd/nfs_subr.c +++ b/usr.sbin/amd/amd/nfs_subr.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * from: @(#)nfs_subr.c 8.1 (Berkeley) 6/6/93 - * $Id: nfs_subr.c,v 1.1 1995/10/18 08:47:11 deraadt Exp $ + * $Id: nfs_subr.c,v 1.2 2002/07/18 00:50:23 pvalchev Exp $ */ #include "am.h" @@ -53,11 +53,7 @@ NFS_ERROR_MAPPING #define nfs_error(e) ((nfsstat)(e)) #endif /* NFS_ERROR_MAPPING */ -static char *do_readlink P((am_node *mp, int *error_return, struct attrstat **attrpp)); -static char *do_readlink(mp, error_return, attrpp) -am_node *mp; -int *error_return; -struct attrstat **attrpp; +static char *do_readlink(am_node *mp, int *error_return, struct attrstat **attrpp) { char *ln; @@ -86,10 +82,7 @@ struct attrstat **attrpp; } /*ARGSUSED*/ -voidp -nfsproc_null_2(argp, rqstp) -voidp argp; -struct svc_req *rqstp; +voidp nfsproc_null_2(voidp argp, struct svc_req *rqstp) { static char res; @@ -98,10 +91,8 @@ struct svc_req *rqstp; /*ARGSUSED*/ -struct attrstat * -nfsproc_getattr_2(argp, rqstp) -struct nfs_fh *argp; -struct svc_req *rqstp; +struct attrstat *nfsproc_getattr_2(struct nfs_fh *argp, + struct svc_req *rqstp) { static struct attrstat res; am_node *mp; @@ -147,10 +138,8 @@ getattr_retry: /*ARGSUSED*/ -struct attrstat * -nfsproc_setattr_2(argp, rqstp) -struct sattrargs *argp; -struct svc_req *rqstp; +struct attrstat *nfsproc_setattr_2(struct sattrargs *argp, + struct svc_req *rqstp) { static struct attrstat res; @@ -164,10 +153,7 @@ struct svc_req *rqstp; /*ARGSUSED*/ -voidp -nfsproc_root_2(argp, rqstp) -voidp argp; -struct svc_req *rqstp; +voidp nfsproc_root_2(voidp argp, struct svc_req *rqstp) { static char res; @@ -176,10 +162,8 @@ struct svc_req *rqstp; /*ARGSUSED*/ -struct diropres * -nfsproc_lookup_2(argp, rqstp) -struct diropargs *argp; -struct svc_req *rqstp; +struct diropres *nfsproc_lookup_2(struct diropargs *argp, + struct svc_req *rqstp) { static struct diropres res; am_node *mp; @@ -226,10 +210,8 @@ struct svc_req *rqstp; /*ARGSUSED*/ -struct readlinkres * -nfsproc_readlink_2(argp, rqstp) -struct nfs_fh *argp; -struct svc_req *rqstp; +struct readlinkres *nfsproc_readlink_2(struct nfs_fh *argp, + struct svc_req *rqstp) { static struct readlinkres res; am_node *mp; @@ -265,10 +247,8 @@ readlink_retry: /*ARGSUSED*/ -struct readres * -nfsproc_read_2(argp, rqstp) -struct readargs *argp; -struct svc_req *rqstp; +struct readres *nfsproc_read_2(struct readargs *argp, + struct svc_req *rqstp) { static struct readres res; @@ -281,10 +261,7 @@ struct svc_req *rqstp; /*ARGSUSED*/ -voidp -nfsproc_writecache_2(argp, rqstp) -voidp argp; -struct svc_req *rqstp; +voidp nfsproc_writecache_2(voidp argp, struct svc_req *rqstp) { static char res; @@ -293,10 +270,8 @@ struct svc_req *rqstp; /*ARGSUSED*/ -struct attrstat * -nfsproc_write_2(argp, rqstp) -writeargs *argp; -struct svc_req *rqstp; +struct attrstat *nfsproc_write_2(writeargs *argp, + struct svc_req *rqstp) { static struct attrstat res; @@ -310,10 +285,8 @@ struct svc_req *rqstp; /*ARGSUSED*/ -struct diropres * -nfsproc_create_2(argp, rqstp) -createargs *argp; -struct svc_req *rqstp; +struct diropres *nfsproc_create_2(createargs *argp, + struct svc_req *rqstp) { static struct diropres res; @@ -327,11 +300,8 @@ struct svc_req *rqstp; /*ARGSUSED*/ -static nfsstat * -unlink_or_rmdir(argp, rqstp, unlinkp) -struct diropargs *argp; -struct svc_req *rqstp; -int unlinkp; +static nfsstat *unlink_or_rmdir(struct diropargs *argp, + struct svc_req *rqstp, int unlinkp) { static nfsstat res; int retry; @@ -376,19 +346,13 @@ out: /*ARGSUSED*/ -nfsstat * -nfsproc_remove_2(argp, rqstp) -struct diropargs *argp; -struct svc_req *rqstp; +nfsstat *nfsproc_remove_2(struct diropargs *argp, struct svc_req *rqstp) { return unlink_or_rmdir(argp, rqstp, TRUE); } /*ARGSUSED*/ -nfsstat * -nfsproc_rename_2(argp, rqstp) -renameargs *argp; -struct svc_req *rqstp; +nfsstat *nfsproc_rename_2(renameargs *argp, struct svc_req *rqstp) { static nfsstat res; if (!fh_to_mp(&argp->from.dir) || !fh_to_mp(&argp->to.dir)) @@ -409,10 +373,7 @@ struct svc_req *rqstp; /*ARGSUSED*/ -nfsstat * -nfsproc_link_2(argp, rqstp) -linkargs *argp; -struct svc_req *rqstp; +nfsstat *nfsproc_link_2(linkargs *argp, struct svc_req *rqstp) { static nfsstat res; if (!fh_to_mp(&argp->from) || !fh_to_mp(&argp->to.dir)) @@ -425,10 +386,7 @@ struct svc_req *rqstp; /*ARGSUSED*/ -nfsstat * -nfsproc_symlink_2(argp, rqstp) -symlinkargs *argp; -struct svc_req *rqstp; +nfsstat *nfsproc_symlink_2(symlinkargs *argp, struct svc_req *rqstp) { static nfsstat res; if (!fh_to_mp(&argp->from.dir)) @@ -441,10 +399,7 @@ struct svc_req *rqstp; /*ARGSUSED*/ -struct diropres * -nfsproc_mkdir_2(argp, rqstp) -createargs *argp; -struct svc_req *rqstp; +struct diropres *nfsproc_mkdir_2(createargs *argp, struct svc_req *rqstp) { static struct diropres res; if (!fh_to_mp(&argp->where.dir)) @@ -457,20 +412,15 @@ struct svc_req *rqstp; /*ARGSUSED*/ -nfsstat * -nfsproc_rmdir_2(argp, rqstp) -struct diropargs *argp; -struct svc_req *rqstp; +nfsstat *nfsproc_rmdir_2(struct diropargs *argp, struct svc_req *rqstp) { return unlink_or_rmdir(argp, rqstp, FALSE); } /*ARGSUSED*/ -struct readdirres * -nfsproc_readdir_2(argp, rqstp) -readdirargs *argp; -struct svc_req *rqstp; +struct readdirres *nfsproc_readdir_2(readdirargs *argp, + struct svc_req *rqstp) { static readdirres res; static entry e_res[MAX_READDIR_ENTRIES]; @@ -501,10 +451,8 @@ struct svc_req *rqstp; } /*ARGSUSED*/ -struct statfsres * -nfsproc_statfs_2(argp, rqstp) -struct nfs_fh *argp; -struct svc_req *rqstp; +struct statfsres *nfsproc_statfs_2(struct nfs_fh *argp, + struct svc_req *rqstp) { static statfsres res; am_node *mp; -- cgit v1.2.3