Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.sbin/mountd ANSIfy. Use __dead.



details:   https://anonhg.NetBSD.org/src/rev/7fc23e663982
branches:  trunk
changeset: 769052:7fc23e663982
user:      joerg <joerg%NetBSD.org@localhost>
date:      Tue Aug 30 20:00:58 2011 +0000

description:
ANSIfy. Use __dead.

diffstat:

 usr.sbin/mountd/mountd.c |  293 ++++++++++++++++------------------------------
 1 files changed, 102 insertions(+), 191 deletions(-)

diffs (truncated from 588 to 300 lines):

diff -r 975b526fee7d -r 7fc23e663982 usr.sbin/mountd/mountd.c
--- a/usr.sbin/mountd/mountd.c  Tue Aug 30 19:49:10 2011 +0000
+++ b/usr.sbin/mountd/mountd.c  Tue Aug 30 20:00:58 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mountd.c,v 1.121 2011/08/30 17:06:21 plunky Exp $       */
+/*     $NetBSD: mountd.c,v 1.122 2011/08/30 20:00:58 joerg Exp $        */
 
 /*
  * Copyright (c) 1989, 1993
@@ -42,7 +42,7 @@
 #if 0
 static char     sccsid[] = "@(#)mountd.c  8.15 (Berkeley) 5/1/95";
 #else
-__RCSID("$NetBSD: mountd.c,v 1.121 2011/08/30 17:06:21 plunky Exp $");
+__RCSID("$NetBSD: mountd.c,v 1.122 2011/08/30 20:00:58 joerg Exp $");
 #endif
 #endif                         /* not lint */
 
@@ -164,57 +164,57 @@
 };
 
 /* Global defs */
-static char    *add_expdir __P((struct dirlist **, char *, int));
-static void add_dlist __P((struct dirlist **, struct dirlist *,
-    struct grouplist *, int));
-static void add_mlist __P((char *, char *, int));
-static int check_dirpath __P((const char *, size_t, char *));
-static int check_options __P((const char *, size_t, struct dirlist *));
-static int chk_host __P((struct dirlist *, struct sockaddr *, int *, int *));
-static int del_mlist __P((char *, char *, struct sockaddr *));
-static struct dirlist *dirp_search __P((struct dirlist *, char *));
-static int do_nfssvc __P((const char *, size_t, struct exportlist *,
-    struct grouplist *, int, struct uucred *, char *, int, struct statvfs *));
-static int do_opt __P((const char *, size_t, char **, char **,
-    struct exportlist *, struct grouplist *, int *, int *, struct uucred *));
-static struct exportlist *ex_search __P((fsid_t *));
-static int parse_directory __P((const char *, size_t, struct grouplist *,
-    int, char *, struct exportlist **, struct statvfs *));
-static int parse_host_netgroup __P((const char *, size_t, struct exportlist *,
-    struct grouplist *, char *, int *, struct grouplist **));
-static struct exportlist *get_exp __P((void));
-static void free_dir __P((struct dirlist *));
-static void free_exp __P((struct exportlist *));
-static void free_grp __P((struct grouplist *));
-static void free_host __P((struct hostlist *));
-static void get_exportlist __P((int));
-static int get_host __P((const char *, size_t, const char *,
-    struct grouplist *));
-static struct hostlist *get_ht __P((void));
-static void get_mountlist __P((void));
-static int get_net __P((char *, struct netmsk *, int));
-static void free_exp_grp __P((struct exportlist *, struct grouplist *));
-static struct grouplist *get_grp __P((void));
-static void hang_dirp __P((struct dirlist *, struct grouplist *,
-    struct exportlist *, int));
-static void mntsrv __P((struct svc_req *, SVCXPRT *));
-static void nextfield __P((char **, char **));
-static void parsecred __P((char *, struct uucred *));
-static int put_exlist __P((struct dirlist *, XDR *, struct dirlist *, int *));
-static int scan_tree __P((struct dirlist *, struct sockaddr *));
-static void send_umntall __P((int));
-static int umntall_each __P((caddr_t, struct sockaddr_in *));
-static int xdr_dir __P((XDR *, char *));
-static int xdr_explist __P((XDR *, caddr_t));
-static int xdr_fhs __P((XDR *, caddr_t));
-static int xdr_mlist __P((XDR *, caddr_t));
-static int bitcmp __P((void *, void *, int));
-static int netpartcmp __P((struct sockaddr *, struct sockaddr *, int));
-static int sacmp __P((struct sockaddr *, struct sockaddr *));
-static int allones __P((struct sockaddr_storage *, int));
-static int countones __P((struct sockaddr *));
-static void bind_resv_port __P((int, sa_family_t, in_port_t));
-static void no_nfs(int);
+static char    *add_expdir(struct dirlist **, char *, int);
+static void add_dlist(struct dirlist **, struct dirlist *,
+    struct grouplist *, int);
+static void add_mlist(char *, char *, int);
+static int check_dirpath(const char *, size_t, char *);
+static int check_options(const char *, size_t, struct dirlist *);
+static int chk_host(struct dirlist *, struct sockaddr *, int *, int *);
+static int del_mlist(char *, char *, struct sockaddr *);
+static struct dirlist *dirp_search(struct dirlist *, char *);
+static int do_nfssvc(const char *, size_t, struct exportlist *,
+    struct grouplist *, int, struct uucred *, char *, int, struct statvfs *);
+static int do_opt(const char *, size_t, char **, char **,
+    struct exportlist *, struct grouplist *, int *, int *, struct uucred *);
+static struct exportlist *ex_search(fsid_t *);
+static int parse_directory(const char *, size_t, struct grouplist *,
+    int, char *, struct exportlist **, struct statvfs *);
+static int parse_host_netgroup(const char *, size_t, struct exportlist *,
+    struct grouplist *, char *, int *, struct grouplist **);
+static struct exportlist *get_exp(void);
+static void free_dir(struct dirlist *);
+static void free_exp(struct exportlist *);
+static void free_grp(struct grouplist *);
+static void free_host(struct hostlist *);
+static void get_exportlist(int);
+static int get_host(const char *, size_t, const char *,
+    struct grouplist *);
+static struct hostlist *get_ht(void);
+static void get_mountlist(void);
+static int get_net(char *, struct netmsk *, int);
+static void free_exp_grp(struct exportlist *, struct grouplist *);
+static struct grouplist *get_grp(void);
+static void hang_dirp(struct dirlist *, struct grouplist *,
+    struct exportlist *, int);
+static void mntsrv(struct svc_req *, SVCXPRT *);
+static void nextfield(char **, char **);
+static void parsecred(char *, struct uucred *);
+static int put_exlist(struct dirlist *, XDR *, struct dirlist *, int *);
+static int scan_tree(struct dirlist *, struct sockaddr *);
+__dead static void send_umntall(int);
+static int umntall_each(caddr_t, struct sockaddr_in *);
+static int xdr_dir(XDR *, char *);
+static int xdr_explist(XDR *, caddr_t);
+static int xdr_fhs(XDR *, caddr_t);
+static int xdr_mlist(XDR *, caddr_t);
+static int bitcmp(void *, void *, int);
+static int netpartcmp(struct sockaddr *, struct sockaddr *, int);
+static int sacmp(struct sockaddr *, struct sockaddr *);
+static int allones(struct sockaddr_storage *, int);
+static int countones(struct sockaddr *);
+static void bind_resv_port(int, sa_family_t, in_port_t);
+__dead static void no_nfs(int);
 static struct exportlist *exphead;
 static struct mountlist *mlhead;
 static struct grouplist *grphead;
@@ -244,9 +244,8 @@
 
 static int      debug = 0;
 #if 0
-static void SYSLOG __P((int, const char *,...));
+static void SYSLOG(int, const char *,...);
 #endif
-int main __P((int, char *[]));
 
 /*
  * If this is non-zero, -noresvport and -noresvmnt are implied for
@@ -263,9 +262,7 @@
  * and "-n" to allow nonroot mount.
  */
 int
-main(argc, argv)
-       int argc;
-       char **argv;
+main(int argc, char **argv)
 {
        SVCXPRT *udptransp, *tcptransp, *udp6transp, *tcp6transp;
        struct netconfig *udpconf, *tcpconf, *udp6conf, *tcp6conf;
@@ -475,9 +472,7 @@
  * The mount rpc service
  */
 void
-mntsrv(rqstp, transp)
-       struct svc_req *rqstp;
-       SVCXPRT *transp;
+mntsrv(struct svc_req *rqstp, SVCXPRT *transp)
 {
        struct exportlist *ep;
        struct dirlist *dp;
@@ -661,9 +656,7 @@
  * Xdr conversion for a dirpath string
  */
 static int
-xdr_dir(xdrsp, dirp)
-       XDR *xdrsp;
-       char *dirp;
+xdr_dir(XDR *xdrsp, char *dirp)
 {
 
        return (xdr_string(xdrsp, &dirp, RPCMNT_PATHLEN));
@@ -673,9 +666,7 @@
  * Xdr routine to generate file handle reply
  */
 static int
-xdr_fhs(xdrsp, cp)
-       XDR *xdrsp;
-       caddr_t cp;
+xdr_fhs(XDR *xdrsp, caddr_t cp)
 {
        struct fhreturn *fhrp = (struct fhreturn *) cp;
        long ok = 0, len, auth;
@@ -704,9 +695,7 @@
 }
 
 int
-xdr_mlist(xdrsp, cp)
-       XDR *xdrsp;
-       caddr_t cp;
+xdr_mlist(XDR *xdrsp, caddr_t cp)
 {
        struct mountlist *mlp;
        int trueval = 1;
@@ -734,9 +723,7 @@
  * Xdr conversion for export list
  */
 int
-xdr_explist(xdrsp, cp)
-       XDR *xdrsp;
-       caddr_t cp;
+xdr_explist(XDR *xdrsp, caddr_t cp)
 {
        struct exportlist *ep;
        int falseval = 0;
@@ -770,11 +757,7 @@
  * directory paths.  Assumes SIGHUP has already been masked.
  */
 int
-put_exlist(dp, xdrsp, adp, putdefp)
-       struct dirlist *dp;
-       XDR *xdrsp;
-       struct dirlist *adp;
-       int *putdefp;
+put_exlist(struct dirlist *dp, XDR *xdrsp, struct dirlist *adp, int *putdefp)
 {
        struct grouplist *grp;
        struct hostlist *hp;
@@ -832,14 +815,8 @@
 }
 
 static int
-parse_host_netgroup(line, lineno, ep, tgrp, cp, has_host, grp)
-       const char *line;
-       size_t lineno;
-       struct exportlist *ep;
-       struct grouplist *tgrp;
-       char *cp;
-       int *has_host;
-       struct grouplist **grp;
+parse_host_netgroup(const char *line, size_t lineno, struct exportlist *ep,
+    struct grouplist *tgrp, char *cp, int *has_host, struct grouplist **grp)
 {
        const char *hst, *usr, *dom;
        int netgrp;
@@ -879,14 +856,8 @@
 }
 
 static int
-parse_directory(line, lineno, tgrp, got_nondir, cp, ep, fsp)
-       const char *line;
-       size_t lineno;
-       struct grouplist *tgrp;
-       int got_nondir;
-       char *cp;
-       struct exportlist **ep;
-       struct statvfs *fsp;
+parse_directory(const char *line, size_t lineno, struct grouplist *tgrp,
+    int got_nondir, char *cp, struct exportlist **ep, struct statvfs *fsp)
 {
        if (!check_dirpath(line, lineno, cp))
                return 0;
@@ -942,8 +913,7 @@
  */
 /* ARGSUSED */
 void
-get_exportlist(n)
-       int n;
+get_exportlist(int n)
 {
        struct exportlist *ep, *ep2;
        struct grouplist *grp, *tgrp;
@@ -1198,7 +1168,7 @@
  * Allocate an export list element
  */
 static struct exportlist *
-get_exp()
+get_exp(void)
 {
        struct exportlist *ep;
 
@@ -1211,7 +1181,7 @@
  * Allocate a group list element
  */
 static struct grouplist *
-get_grp()
+get_grp(void)
 {
        struct grouplist *gp;
 
@@ -1224,9 +1194,7 @@
  * Clean up upon an error in get_exportlist().
  */
 static void
-free_exp_grp(ep, grp)
-       struct exportlist *ep;
-       struct grouplist *grp;
+free_exp_grp(struct exportlist *ep, struct grouplist *grp)
 {
        struct grouplist *tgrp;
 
@@ -1243,8 +1211,7 @@
  * Search the export list for a matching fs.
  */
 static struct exportlist *
-ex_search(fsid)
-       fsid_t *fsid;
+ex_search(fsid_t *fsid)
 {
        struct exportlist *ep;
 



Home | Main Index | Thread Index | Old Index