diff options
author | delphij <delphij@FreeBSD.org> | 2009-05-29 22:19:45 +0000 |
---|---|---|
committer | delphij <delphij@FreeBSD.org> | 2009-05-29 22:19:45 +0000 |
commit | 33788b835ac6a92ff1d9f3b055fef3b530c73c88 (patch) | |
tree | 4bf896c829046e6de251d55cf3096e08b263707f /usr.sbin/nfsrevoke | |
parent | d5497c5f03e86dc1d79ef7771c9a4031b700af1e (diff) | |
download | FreeBSD-src-33788b835ac6a92ff1d9f3b055fef3b530c73c88.zip FreeBSD-src-33788b835ac6a92ff1d9f3b055fef3b530c73c88.tar.gz |
Code cleanup for nfs4 utilities:
- Mark internal routines as static;
- Eliminate unused parameters where possible, mark __unused for others;
- Remove unused variables;
- Use %jd for int64_t values in printf();
- Add appropriate %d for printf to match its parameter;
- Rename a variable to resolve conflict with revoke(2);
Reviewed by: rmacklem
Tested with: make universe (bugs are mine)
Diffstat (limited to 'usr.sbin/nfsrevoke')
-rw-r--r-- | usr.sbin/nfsrevoke/nfsrevoke.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/usr.sbin/nfsrevoke/nfsrevoke.c b/usr.sbin/nfsrevoke/nfsrevoke.c index f6ba813..85eb48b 100644 --- a/usr.sbin/nfsrevoke/nfsrevoke.c +++ b/usr.sbin/nfsrevoke/nfsrevoke.c @@ -57,8 +57,7 @@ __FBSDID("$FreeBSD$"); #include <string.h> #include <unistd.h> -void usage(void); -extern int errno; +static void usage(void); int main(int argc, char **argv) @@ -66,7 +65,7 @@ main(int argc, char **argv) char *cp; u_char val; int cnt, even; - struct nfsd_clid revoke; + struct nfsd_clid revoke_handle; if (modfind("nfsd") < 0) errx(1, "nfsd not loaded - self terminating"); @@ -80,7 +79,7 @@ main(int argc, char **argv) even = 1; val = 0; while (*cp) { - if (*cp >= '0' & *cp <= '9') + if (*cp >= '0' && *cp <= '9') val += (u_char)(*cp - '0'); else if (*cp >= 'A' && *cp <= 'F') val += ((u_char)(*cp - 'A')) + 0xa; @@ -92,7 +91,7 @@ main(int argc, char **argv) val <<= 4; even = 0; } else { - revoke.nclid_id[cnt++] = val; + revoke_handle.nclid_id[cnt++] = val; if (cnt > NFSV4_OPAQUELIMIT) errx(1, "Clientid %s, loo long", argv[1]); val = 0; @@ -104,19 +103,19 @@ main(int argc, char **argv) /* * Do the revocation system call. */ - revoke.nclid_idlen = cnt; + revoke_handle.nclid_idlen = cnt; #ifdef DEBUG - printf("Idlen=%d\n", revoke.nclid_idlen); - for (cnt = 0; cnt < revoke.nclid_idlen; cnt++) - printf("%02x", revoke.nclid_id[cnt]); + printf("Idlen=%d\n", revoke_handle.nclid_idlen); + for (cnt = 0; cnt < revoke_handle.nclid_idlen; cnt++) + printf("%02x", revoke_handle.nclid_id[cnt]); printf("\n"); #else - if (nfssvc(NFSSVC_ADMINREVOKE, &revoke) < 0) + if (nfssvc(NFSSVC_ADMINREVOKE, &revoke_handle) < 0) err(1, "Admin revoke failed"); #endif } -void +static void usage(void) { |