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. */
};
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 *newiovlen,
* 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 iovlen, int mntflags)
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 **iov, int *iovlen)
* 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 rpc_err *rpcerr)
*
* 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]",