MFC r203461:

static'ify function prototypes and convert K&R to ANSI.
This commit is contained in:
Xin LI 2010-03-05 00:33:05 +00:00
parent 949a9c3cf1
commit 3905c549f0

View File

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