Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 5 Mar 2010 00:33:05 +0000 (UTC)
From:      Xin LI <delphij@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r204745 - stable/8/sbin/mount_nfs
Message-ID:  <201003050033.o250X5eN035659@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: delphij
Date: Fri Mar  5 00:33:05 2010
New Revision: 204745
URL: http://svn.freebsd.org/changeset/base/204745

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

Modified:
  stable/8/sbin/mount_nfs/mount_nfs.c
Directory Properties:
  stable/8/sbin/mount_nfs/   (props changed)

Modified: stable/8/sbin/mount_nfs/mount_nfs.c
==============================================================================
--- stable/8/sbin/mount_nfs/mount_nfs.c	Fri Mar  5 00:32:22 2010	(r204744)
+++ stable/8/sbin/mount_nfs/mount_nfs.c	Fri Mar  5 00:33:05 2010	(r204745)
@@ -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;
@@ -849,7 +848,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)
 {
@@ -1071,7 +1070,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) {
@@ -1106,7 +1105,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;
@@ -1126,7 +1125,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 {
@@ -1154,13 +1153,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;
@@ -1206,8 +1205,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?201003050033.o250X5eN035659>