diff options
author | Karel Zak | 2007-10-25 10:39:23 +0200 |
---|---|---|
committer | Karel Zak | 2007-10-25 21:50:59 +0200 |
commit | be551c7282fe74aca5a07dc6b2ce49ecbea48c90 (patch) | |
tree | be464246dc7329124ff3989a64f4ef5d50793f75 | |
parent | losetup: remove duplicate xstrdup() and error() (diff) | |
download | kernel-qcow2-util-linux-be551c7282fe74aca5a07dc6b2ce49ecbea48c90.tar.gz kernel-qcow2-util-linux-be551c7282fe74aca5a07dc6b2ce49ecbea48c90.tar.xz kernel-qcow2-util-linux-be551c7282fe74aca5a07dc6b2ce49ecbea48c90.zip |
mount: clean up global variables
Signed-off-by: Karel Zak <kzak@redhat.com>
-rw-r--r-- | mount/fstab.c | 4 | ||||
-rw-r--r-- | mount/lomount.c | 5 | ||||
-rw-r--r-- | mount/lomount.h | 1 | ||||
-rw-r--r-- | mount/mount.c | 11 | ||||
-rw-r--r-- | mount/sundries.c | 2 | ||||
-rw-r--r-- | mount/sundries.h | 4 | ||||
-rw-r--r-- | mount/swapon.c | 5 | ||||
-rw-r--r-- | mount/umount.c | 5 |
8 files changed, 9 insertions, 28 deletions
diff --git a/mount/fstab.c b/mount/fstab.c index 7baa68ee5..cd7560988 100644 --- a/mount/fstab.c +++ b/mount/fstab.c @@ -810,11 +810,7 @@ update_mtab (const char *dir, struct my_mntent *instead) { * The test is very simple -- it reads a number from locked file, increments the * number and writes the number back to the file. */ - /* dummy */ -int verbose; -char *progname; - const char *fsprobe_get_label_by_devname(const char *spec) { return NULL; } const char *fsprobe_get_uuid_by_devname(const char *spec) { return NULL; } struct my_mntent *my_getmntent (mntFILE *mfp) { return NULL; } diff --git a/mount/lomount.c b/mount/lomount.c index 1373067cf..02b337f31 100644 --- a/mount/lomount.c +++ b/mount/lomount.c @@ -25,8 +25,6 @@ #include "sundries.h" #include "xmalloc.h" -extern char *progname; - #define SIZE(a) (sizeof(a)/sizeof(a[0])) #ifdef LOOP_SET_FD @@ -442,9 +440,6 @@ find_unused_loop_device (void) { #include <getopt.h> #include <stdarg.h> -int verbose = 0; -char *progname; - static void usage(void) { fprintf(stderr, _("\nUsage:\n" diff --git a/mount/lomount.h b/mount/lomount.h index 89695cd71..c5c913b5e 100644 --- a/mount/lomount.h +++ b/mount/lomount.h @@ -1,4 +1,3 @@ -extern int verbose; extern int set_loop(const char *, const char *, unsigned long long, const char *, int, int *); extern int del_loop(const char *); diff --git a/mount/mount.c b/mount/mount.c index f7ff56e1b..8ec3730da 100644 --- a/mount/mount.c +++ b/mount/mount.c @@ -62,17 +62,14 @@ static int nomtab = 0; /* True for explicit readonly (-r). */ static int readonly = 0; -/* Nonzero for chatty (-v). */ -int verbose = 0; - /* Nonzero for sloppy (-s). */ -int sloppy = 0; +static int sloppy = 0; /* True for explicit read/write (-w). */ static int readwrite = 0; /* True for all mount (-a). */ -int mount_all = 0; +static int mount_all = 0; /* True for fork() during all mount (-F). */ static int optfork = 0; @@ -81,7 +78,7 @@ static int optfork = 0; static int list_with_volumelabel = 0; /* Nonzero for mount {--bind|--replace|--before|--after|--over|--move| - * make-shared|make-private|make-unbindable|make-slave} + * make-shared|make-private|make-unbindable|make-slave} */ static int mounttype = 0; @@ -1773,8 +1770,6 @@ getfs(const char *spec, const char *uuid, const char *label) return mc; } -char *progname; - int main(int argc, char *argv[]) { int c, result = 0, specseen; diff --git a/mount/sundries.c b/mount/sundries.c index 0c7c6e1e9..ba99e3532 100644 --- a/mount/sundries.c +++ b/mount/sundries.c @@ -19,6 +19,8 @@ #include "nls.h" int mount_quiet; +int verbose; +char *progname; char * xstrndup (const char *s, int n) { diff --git a/mount/sundries.h b/mount/sundries.h index 010eece48..0853fc2ce 100644 --- a/mount/sundries.h +++ b/mount/sundries.h @@ -16,13 +16,13 @@ #include <rpc/types.h> #endif +/* global mount, umount, and losetup variables */ extern int mount_quiet; extern int verbose; -extern int sloppy; +extern char *progname; #define streq(s, t) (strcmp ((s), (t)) == 0) -/* Functions in sundries.c that are used in mount.c and umount.c */ void block_signals (int how); void error (const char *fmt, ...) diff --git a/mount/swapon.c b/mount/swapon.c index 5e8c6eb0f..5180fafe8 100644 --- a/mount/swapon.c +++ b/mount/swapon.c @@ -34,14 +34,13 @@ #define CANONIC 1 int all = 0; -int verbose = 0; int priority = -1; /* non-prioritized swap by default */ +int verbose; +char *progname; /* If true, don't complain if the device/file doesn't exist */ int ifexists = 0; -char *progname; - static struct option longswaponopts[] = { /* swapon only */ { "priority", required_argument, 0, 'p' }, diff --git a/mount/umount.c b/mount/umount.c index ab179c219..9690f2ac0 100644 --- a/mount/umount.c +++ b/mount/umount.c @@ -74,9 +74,6 @@ int nomtab = 0; /* Call losetup -d for each unmounted loop device. */ int delloop = 0; -/* Nonzero for chatty (-v). */ -int verbose = 0; - /* True if ruid != euid. */ int suid = 0; @@ -556,8 +553,6 @@ umount_file (char *arg) { return umount_one (arg, arg, arg, arg, NULL); } -char *progname; - int main (int argc, char *argv[]) { int c; |