mount: clean up global variables

Signed-off-by: Karel Zak <kzak@redhat.com>
This commit is contained in:
Karel Zak 2007-10-25 10:39:23 +02:00
parent 0b994f0e93
commit be551c7282
8 changed files with 9 additions and 28 deletions

View File

@ -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; }

View File

@ -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"

View File

@ -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 *);

View File

@ -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;

View File

@ -19,6 +19,8 @@
#include "nls.h"
int mount_quiet;
int verbose;
char *progname;
char *
xstrndup (const char *s, int n) {

View File

@ -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, ...)

View File

@ -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' },

View File

@ -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;