diff options
author | jkim <jkim@FreeBSD.org> | 2013-03-05 22:41:35 +0000 |
---|---|---|
committer | jkim <jkim@FreeBSD.org> | 2013-03-05 22:41:35 +0000 |
commit | 475f470cf1bcd7615e6405a71ccdd43f22a0dd54 (patch) | |
tree | 2bf559632576aeda40b2632bd7a6fb5f6d18587b | |
parent | 161f82b0bdb9e0bc8b3a3037ded59c981f4a9cf2 (diff) | |
download | FreeBSD-src-475f470cf1bcd7615e6405a71ccdd43f22a0dd54.zip FreeBSD-src-475f470cf1bcd7615e6405a71ccdd43f22a0dd54.tar.gz |
GC unused variables. Prefer NULL over 0 for pointers.
-rw-r--r-- | sbin/mount_cd9660/mount_cd9660.c | 6 | ||||
-rw-r--r-- | sbin/mount_msdosfs/mount_msdosfs.c | 7 | ||||
-rw-r--r-- | sbin/mount_nfs/mount_nfs.c | 13 | ||||
-rw-r--r-- | sbin/mount_nullfs/mount_nullfs.c | 5 | ||||
-rw-r--r-- | sbin/mount_reiserfs/mount_reiserfs.c | 2 | ||||
-rw-r--r-- | sbin/mount_std/mount_std.c | 2 | ||||
-rw-r--r-- | sbin/mount_udf/mount_udf.c | 6 | ||||
-rw-r--r-- | sbin/mount_unionfs/mount_unionfs.c | 5 |
8 files changed, 21 insertions, 25 deletions
diff --git a/sbin/mount_cd9660/mount_cd9660.c b/sbin/mount_cd9660/mount_cd9660.c index 2215966..7ea6064 100644 --- a/sbin/mount_cd9660/mount_cd9660.c +++ b/sbin/mount_cd9660/mount_cd9660.c @@ -83,7 +83,7 @@ main(int argc, char **argv) { struct iovec *iov; int iovlen; - int ch, mntflags, opts; + int ch, mntflags; char *dev, *dir, *p, *val, mntpath[MAXPATHLEN]; int verbose; int ssector; /* starting sector, 0 for 1st session */ @@ -91,7 +91,7 @@ main(int argc, char **argv) iov = NULL; iovlen = 0; - mntflags = opts = verbose = 0; + mntflags = verbose = 0; ssector = -1; while ((ch = getopt(argc, argv, "begjo:rs:vC:")) != -1) @@ -109,7 +109,7 @@ main(int argc, char **argv) build_iovec(&iov, &iovlen, "nojoliet", NULL, (size_t)-1); break; case 'o': - getmntopts(optarg, mopts, &mntflags, &opts); + getmntopts(optarg, mopts, &mntflags, NULL); p = strchr(optarg, '='); val = NULL; if (p != NULL) { diff --git a/sbin/mount_msdosfs/mount_msdosfs.c b/sbin/mount_msdosfs/mount_msdosfs.c index 3da673d..8814fdd 100644 --- a/sbin/mount_msdosfs/mount_msdosfs.c +++ b/sbin/mount_msdosfs/mount_msdosfs.c @@ -69,7 +69,7 @@ main(int argc, char **argv) struct iovec *iov = NULL; int iovlen = 0; struct stat sb; - int c, mntflags, set_gid, set_uid, set_mask, set_dirmask; + int c, set_gid, set_uid, set_mask, set_dirmask; char *dev, *dir, mntpath[MAXPATHLEN], *csp; char fstype[] = "msdosfs"; char errmsg[255] = {0}; @@ -78,9 +78,8 @@ main(int argc, char **argv) mode_t mask = 0, dirmask = 0; uid_t uid = 0; gid_t gid = 0; - getmnt_silent = 1; - mntflags = set_gid = set_uid = set_mask = set_dirmask = 0; + set_gid = set_uid = set_mask = set_dirmask = 0; while ((c = getopt(argc, argv, "sl9u:g:m:M:o:L:D:W:")) != -1) { switch (c) { @@ -219,7 +218,7 @@ main(int argc, char **argv) build_iovec_argf(&iov, &iovlen, "mask", "%u", mask); build_iovec_argf(&iov, &iovlen, "dirmask", "%u", dirmask); - if (nmount(iov, iovlen, mntflags) < 0) { + if (nmount(iov, iovlen, 0) < 0) { if (errmsg[0]) err(1, "%s: %s", dev, errmsg); else diff --git a/sbin/mount_nfs/mount_nfs.c b/sbin/mount_nfs/mount_nfs.c index d71e952..bd016f3 100644 --- a/sbin/mount_nfs/mount_nfs.c +++ b/sbin/mount_nfs/mount_nfs.c @@ -130,7 +130,7 @@ enum tryret { TRYRET_LOCALERR /* Local failure. */ }; -static int fallback_mount(struct iovec *iov, int iovlen, int mntflags); +static int fallback_mount(struct iovec *iov, int iovlen); 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); @@ -149,13 +149,12 @@ main(int argc, char *argv[]) { int c; struct iovec *iov; - int mntflags, num, iovlen; + int num, iovlen; int osversion; char *name, *p, *spec, *fstype; char mntpath[MAXPATHLEN], errmsg[255]; char hostname[MAXHOSTNAMELEN + 1], *gssname, gssn[MAXHOSTNAMELEN + 50]; - mntflags = 0; iov = NULL; iovlen = 0; memset(errmsg, 0, sizeof(errmsg)); @@ -427,10 +426,10 @@ main(int argc, char *argv[]) */ osversion = getosreldate(); if (osversion >= 702100) { - if (nmount(iov, iovlen, mntflags)) + if (nmount(iov, iovlen, 0)) err(1, "%s, %s", mntpath, errmsg); } else { - if (fallback_mount(iov, iovlen, mntflags)) + if (fallback_mount(iov, iovlen)) err(1, "%s, %s", mntpath, errmsg); } @@ -473,7 +472,7 @@ copyopt(struct iovec **newiov, int *newiovlen, * parameters. It should be eventually be removed. */ static int -fallback_mount(struct iovec *iov, int iovlen, int mntflags) +fallback_mount(struct iovec *iov, int iovlen) { struct nfs_args args = { .version = NFS_ARGSVERSION, @@ -663,7 +662,7 @@ fallback_mount(struct iovec *iov, int iovlen, int mntflags) copyopt(&newiov, &newiovlen, iov, iovlen, "fspath"); copyopt(&newiov, &newiovlen, iov, iovlen, "errmsg"); - return nmount(newiov, newiovlen, mntflags); + return nmount(newiov, newiovlen, 0); } static int diff --git a/sbin/mount_nullfs/mount_nullfs.c b/sbin/mount_nullfs/mount_nullfs.c index aaf66e5..e08599f 100644 --- a/sbin/mount_nullfs/mount_nullfs.c +++ b/sbin/mount_nullfs/mount_nullfs.c @@ -68,12 +68,11 @@ main(int argc, char *argv[]) char source[MAXPATHLEN]; char target[MAXPATHLEN]; char errmsg[255]; - int ch, mntflags, iovlen; + int ch, iovlen; char nullfs[] = "nullfs"; iov = NULL; iovlen = 0; - mntflags = 0; errmsg[0] = '\0'; while ((ch = getopt(argc, argv, "o:")) != -1) switch(ch) { @@ -111,7 +110,7 @@ main(int argc, char *argv[]) build_iovec(&iov, &iovlen, "fspath", source, (size_t)-1); build_iovec(&iov, &iovlen, "target", target, (size_t)-1); build_iovec(&iov, &iovlen, "errmsg", errmsg, sizeof(errmsg)); - if (nmount(iov, iovlen, mntflags) < 0) { + if (nmount(iov, iovlen, 0) < 0) { if (errmsg[0] != 0) err(1, "%s: %s", source, errmsg); else diff --git a/sbin/mount_reiserfs/mount_reiserfs.c b/sbin/mount_reiserfs/mount_reiserfs.c index bf62526..1735680 100644 --- a/sbin/mount_reiserfs/mount_reiserfs.c +++ b/sbin/mount_reiserfs/mount_reiserfs.c @@ -58,7 +58,7 @@ main(int argc, char *argv[]) while ((ch = getopt(argc, argv, "o:")) != -1) { switch(ch) { case 'o': - getmntopts(optarg, mopts, &mntflags, 0); + getmntopts(optarg, mopts, &mntflags, NULL); break; case '?': default: diff --git a/sbin/mount_std/mount_std.c b/sbin/mount_std/mount_std.c index c7f1643..50a93ee 100644 --- a/sbin/mount_std/mount_std.c +++ b/sbin/mount_std/mount_std.c @@ -99,7 +99,7 @@ main(int argc, char *argv[]) while ((ch = getopt(argc, argv, "o:")) != -1) switch (ch) { case 'o': - getmntopts(optarg, mopts, &mntflags, 0); + getmntopts(optarg, mopts, &mntflags, NULL); break; case '?': default: diff --git a/sbin/mount_udf/mount_udf.c b/sbin/mount_udf/mount_udf.c index 8ee1286..386ccbb 100644 --- a/sbin/mount_udf/mount_udf.c +++ b/sbin/mount_udf/mount_udf.c @@ -74,17 +74,17 @@ int main(int argc, char **argv) { struct iovec iov[12]; - int ch, i, mntflags, opts, udf_flags; + int ch, i, mntflags, udf_flags; char *dev, *dir, mntpath[MAXPATHLEN]; char *cs_disk, *cs_local; int verbose; - i = mntflags = opts = udf_flags = verbose = 0; + i = mntflags = udf_flags = verbose = 0; cs_disk = cs_local = NULL; while ((ch = getopt(argc, argv, "o:vC:")) != -1) switch (ch) { case 'o': - getmntopts(optarg, mopts, &mntflags, &opts); + getmntopts(optarg, mopts, &mntflags, NULL); break; case 'v': verbose++; diff --git a/sbin/mount_unionfs/mount_unionfs.c b/sbin/mount_unionfs/mount_unionfs.c index c42bf04..1026ecf 100644 --- a/sbin/mount_unionfs/mount_unionfs.c +++ b/sbin/mount_unionfs/mount_unionfs.c @@ -129,7 +129,7 @@ int main(int argc, char *argv[]) { struct iovec *iov; - int ch, mntflags, iovlen; + int ch, iovlen; char source [MAXPATHLEN], target[MAXPATHLEN], errmsg[255]; char uid_str[20], gid_str[20]; char fstype[] = "unionfs"; @@ -137,7 +137,6 @@ main(int argc, char *argv[]) iov = NULL; iovlen = 0; - mntflags = 0; memset(errmsg, 0, sizeof(errmsg)); while ((ch = getopt(argc, argv, "bo:")) != -1) { @@ -190,7 +189,7 @@ main(int argc, char *argv[]) build_iovec(&iov, &iovlen, "from", target, (size_t)-1); build_iovec(&iov, &iovlen, "errmsg", errmsg, sizeof(errmsg)); - if (nmount(iov, iovlen, mntflags)) + if (nmount(iov, iovlen, 0)) err(EX_OSERR, "%s: %s", source, errmsg); exit(0); } |