diff options
| author | joerg <joerg@NetBSD.org> | 2011-08-30 20:29:41 +0000 |
|---|---|---|
| committer | joerg <joerg@NetBSD.org> | 2011-08-30 20:29:41 +0000 |
| commit | df4795aa5a792a19dd48c2d761055e0034eebfb4 (patch) | |
| tree | f16dc8e9308b46a660e69d349c78aee6b01c8b5f /usr.sbin/rpc.bootparamd/bootparamd.c | |
| parent | 855f7656b78bda259ed0300ecb813a28b0474334 (diff) | |
ANSIFy + static + __dead
Diffstat (limited to 'usr.sbin/rpc.bootparamd/bootparamd.c')
| -rw-r--r-- | usr.sbin/rpc.bootparamd/bootparamd.c | 43 |
1 files changed, 15 insertions, 28 deletions
diff --git a/usr.sbin/rpc.bootparamd/bootparamd.c b/usr.sbin/rpc.bootparamd/bootparamd.c index eaf9e2ef61f..e3ac7b53c5e 100644 --- a/usr.sbin/rpc.bootparamd/bootparamd.c +++ b/usr.sbin/rpc.bootparamd/bootparamd.c @@ -1,4 +1,4 @@ -/* $NetBSD: bootparamd.c,v 1.45 2009/04/18 12:57:10 lukem Exp $ */ +/* $NetBSD: bootparamd.c,v 1.46 2011/08/30 20:29:41 joerg Exp $ */ /* * This code is not copyright, and is placed in the public domain. @@ -11,7 +11,7 @@ #include <sys/cdefs.h> #ifndef lint -__RCSID("$NetBSD: bootparamd.c,v 1.45 2009/04/18 12:57:10 lukem Exp $"); +__RCSID("$NetBSD: bootparamd.c,v 1.46 2011/08/30 20:29:41 joerg Exp $"); #endif #include <sys/types.h> @@ -53,7 +53,7 @@ static char hostname[MAX_MACHINE_NAME]; static char askname[MAX_MACHINE_NAME]; static char domain_name[MAX_MACHINE_NAME]; -extern void bootparamprog_1 __P((struct svc_req *, SVCXPRT *)); +extern void bootparamprog_1(struct svc_req *, SVCXPRT *); int _rpcsvcdirty = 0; int _rpcpmstart = 0; @@ -64,19 +64,16 @@ struct sockaddr_in my_addr; const char *bootpfile = _PATH_BOOTPARAMS; char *iface = NULL; -int main __P((int, char *[])); -int lookup_bootparam __P((char *, char *, char *, char **, char **)); -void usage __P((void)); -static int get_localaddr __P((const char *, struct sockaddr_in *)); +static int lookup_bootparam(char *, char *, char *, char **, char **); +__dead static void usage(void); +static int get_localaddr(const char *, struct sockaddr_in *); /* * ever familiar */ int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char *argv[]) { SVCXPRT *transp; struct hostent *he; @@ -154,9 +151,7 @@ main(argc, argv) } bp_whoami_res * -bootparamproc_whoami_1_svc(whoami, rqstp) - bp_whoami_arg *whoami; - struct svc_req *rqstp; +bootparamproc_whoami_1_svc(bp_whoami_arg *whoami, struct svc_req *rqstp) { static bp_whoami_res res; struct hostent *he; @@ -228,9 +223,7 @@ bootparamproc_whoami_1_svc(whoami, rqstp) bp_getfile_res * -bootparamproc_getfile_1_svc(getfile, rqstp) - bp_getfile_arg *getfile; - struct svc_req *rqstp; +bootparamproc_getfile_1_svc(bp_getfile_arg *getfile, struct svc_req *rqstp) { static bp_getfile_res res; struct hostent *he; @@ -312,13 +305,9 @@ bootparamproc_getfile_1_svc(getfile, rqstp) } -int -lookup_bootparam(client, client_canonical, id, server, path) - char *client; - char *client_canonical; - char *id; - char **server; - char **path; +static int +lookup_bootparam(char *client, char *client_canonical, char *id, + char **server, char **path) { FILE *f = fopen(bootpfile, "r"); #ifdef YP @@ -462,8 +451,8 @@ lookup_bootparam(client, client_canonical, id, server, path) return found ? ENOENT : EPERM; } -void -usage() +static void +usage(void) { fprintf(stderr, "usage: %s [-ds] [-i interface] [-r router] [-f bootparamsfile]\n", @@ -472,9 +461,7 @@ usage() } static int -get_localaddr(ifname, sin) - const char *ifname; - struct sockaddr_in *sin; +get_localaddr(const char *ifname, struct sockaddr_in *sin) { struct ifaddrs *ifap, *ifa; |
