Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 3 Feb 2010 23:59:52 +0000 (UTC)
From:      Xin LI <delphij@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r203461 - head/sbin/mount_nfs
Message-ID:  <201002032359.o13NxqRv046998@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: delphij
Date: Wed Feb  3 23:59:52 2010
New Revision: 203461
URL: http://svn.freebsd.org/changeset/base/203461

Log:
  static'ify function prototypes and convert K&R to ANSI.
  
  MFC after:	1 month

Modified:
  head/sbin/mount_nfs/mount_nfs.c

Modified: head/sbin/mount_nfs/mount_nfs.c
==============================================================================
--- head/sbin/mount_nfs/mount_nfs.c	Wed Feb  3 23:58:00 2010	(r203460)
+++ head/sbin/mount_nfs/mount_nfs.c	Wed Feb  3 23:59:52 2010	(r203461)
@@ -130,20 +130,19 @@ enum tryret {
 	TRYRET_LOCALERR		/* Local failure. */
 };
 
-int	fallback_mount(struct iovec *iov, int iovlen, int mntflags);
-int	sec_name_to_num(char *sec);
-char	*sec_num_to_name(int num);
-int	getnfsargs(char *, struct iovec **iov, int *iovlen);
+static int	fallback_mount(struct iovec *iov, int iovlen, int mntflags);
+static int	sec_name_to_num(char *sec);
+static char	*sec_num_to_name(int num);
+static int	getnfsargs(char *, struct iovec **iov, int *iovlen);
 /* void	set_rpc_maxgrouplist(int); */
-struct netconfig *getnetconf_cached(const char *netid);
-const char	*netidbytype(int af, int sotype);
-void	usage(void) __dead2;
-int	xdr_dir(XDR *, char *);
-int	xdr_fh(XDR *, struct nfhret *);
-enum tryret nfs_tryproto(struct addrinfo *ai, char *hostp, char *spec,
+static struct netconfig *getnetconf_cached(const char *netid);
+static const char	*netidbytype(int af, int sotype);
+static void	usage(void) __dead2;
+static int	xdr_dir(XDR *, char *);
+static int	xdr_fh(XDR *, struct nfhret *);
+static enum tryret nfs_tryproto(struct addrinfo *ai, char *hostp, char *spec,
     char **errstr, struct iovec **iov, int *iovlen);
-enum tryret returncode(enum clnt_stat stat, struct rpc_err *rpcerr);
-extern int getosreldate(void);
+static enum tryret returncode(enum clnt_stat stat, struct rpc_err *rpcerr);
 
 int
 main(int argc, char *argv[])
@@ -476,7 +475,7 @@ copyopt(struct iovec **newiov, int *newi
  *      passing NFS mount options to nmount() as individual
  *      parameters.  It should be eventually be removed.
  */
-int
+static int
 fallback_mount(struct iovec *iov, int iovlen, int mntflags)
 {
 	struct nfs_args args = {
@@ -663,7 +662,7 @@ fallback_mount(struct iovec *iov, int io
 	return nmount(newiov, newiovlen, mntflags);
 }
 
-int
+static int
 sec_name_to_num(char *sec)
 {
 	if (!strcmp(sec, "krb5"))
@@ -677,7 +676,7 @@ sec_name_to_num(char *sec)
 	return (-1);
 }
 
-char *
+static char *
 sec_num_to_name(int flavor)
 {
 	switch (flavor) {
@@ -693,7 +692,7 @@ sec_num_to_name(int flavor)
 	return (NULL);
 }
 
-int
+static int
 getnfsargs(char *spec, struct iovec **iov, int *iovlen)
 {
 	struct addrinfo hints, *ai_nfs, *ai;
@@ -839,7 +838,7 @@ getnfsargs(char *spec, struct iovec **io
  * In all error cases, *errstr will be set to a statically-allocated string
  * describing the error.
  */
-enum tryret
+static enum tryret
 nfs_tryproto(struct addrinfo *ai, char *hostp, char *spec, char **errstr,
     struct iovec **iov, int *iovlen)
 {
@@ -1061,7 +1060,7 @@ tryagain:
  * Catagorise a RPC return status and error into an `enum tryret'
  * return code.
  */
-enum tryret
+static enum tryret
 returncode(enum clnt_stat stat, struct rpc_err *rpcerr)
 {
 	switch (stat) {
@@ -1096,7 +1095,7 @@ returncode(enum clnt_stat stat, struct r
  *
  * XXX there should be a library function for this.
  */
-const char *
+static const char *
 netidbytype(int af, int sotype)
 {
 	struct nc_protos *p;
@@ -1116,7 +1115,7 @@ netidbytype(int af, int sotype)
  * Otherwise it behaves just like getnetconfigent(), so nc_*error()
  * work on failure.
  */
-struct netconfig *
+static struct netconfig *
 getnetconf_cached(const char *netid)
 {
 	static struct nc_entry {
@@ -1144,13 +1143,13 @@ getnetconf_cached(const char *netid)
 /*
  * xdr routines for mount rpc's
  */
-int
+static int
 xdr_dir(XDR *xdrsp, char *dirp)
 {
 	return (xdr_string(xdrsp, &dirp, MNTPATHLEN));
 }
 
-int
+static int
 xdr_fh(XDR *xdrsp, struct nfhret *np)
 {
 	int i;
@@ -1196,8 +1195,8 @@ xdr_fh(XDR *xdrsp, struct nfhret *np)
 	return (0);
 }
 
-void
-usage()
+static void
+usage(void)
 {
 	(void)fprintf(stderr, "%s\n%s\n%s\n%s\n",
 "usage: mount_nfs [-23bcdiLlNPsTU] [-a maxreadahead] [-D deadthresh]",



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201002032359.o13NxqRv046998>