Add a handy macro to represent null mount option, MOPT_NULL, and make

use of the macro in sbin/mount*'s, by replacing:

	mopts[] = {
	    MOPT_STDOPTS,
	    { NULL }
	}

With:
	mopts[] = {
	    MOPT_STDOPTS,
	    MOPT_NULL
	}

This change will help to reduce the situation that we don't explicitly
initialize "struct mntopt"'s.  It should not contribute to any
functional/logical changes as far as I can tell.
This commit is contained in:
Xin LI 2005-06-01 09:39:36 +00:00
parent 7a3afb563c
commit 73ac45052f
16 changed files with 18 additions and 15 deletions

View File

@ -65,6 +65,9 @@ struct mntopt {
/* This is parsed by mount(8), but is ignored by specific mount_*(8)s. */
#define MOPT_AUTO { "auto", 0, 0, 0 }
/* A handy macro as terminator of MNT_ array */
#define MOPT_NULL { NULL, 0, 0, 0 }
#define MOPT_FSTAB_COMPAT \
MOPT_RO, \
MOPT_RW, \

View File

@ -64,7 +64,7 @@ static struct mntopt mopts[] = {
MOPT_SYNC,
MOPT_UPDATE,
MOPT_SNAPSHOT,
{ NULL }
MOPT_NULL
};
int

View File

@ -77,7 +77,7 @@ struct mntopt mopts[] = {
{ "rrip", 1, ISOFSMNT_NORRIP, 1 },
{ "joliet", 1, ISOFSMNT_NOJOLIET, 1 },
{ "strictjoliet", 1, ISOFSMNT_BROKENJOLIET, 1 },
{ NULL }
MOPT_NULL
};
int get_ssector(const char *dev);

View File

@ -60,7 +60,7 @@ struct mntopt mopts[] = {
MOPT_FORCE,
MOPT_SYNC,
MOPT_UPDATE,
{ NULL }
MOPT_NULL
};
static void usage(void) __dead2;

View File

@ -50,7 +50,7 @@
static struct mntopt mopts[] = {
MOPT_STDOPTS,
{ NULL }
MOPT_NULL
};
static gid_t a_gid(char *);

View File

@ -73,7 +73,7 @@ static struct mntopt mopts[] = {
{ "shortnames", 0, MSDOSFSMNT_SHORTNAME, 1 },
{ "longnames", 0, MSDOSFSMNT_LONGNAME, 1 },
{ "nowin95", 0, MSDOSFSMNT_NOWIN95, 1 },
{ NULL }
MOPT_NULL
};
static gid_t a_gid(char *);

View File

@ -121,7 +121,7 @@ struct mntopt mopts[] = {
{ "lockd", 1, ALTF_NOLOCKD, 1 },
{ "inet4", 1, ALTF_NOINET4, 1 },
{ "inet6", 1, ALTF_NOINET6, 1 },
{ NULL }
MOPT_NULL
};
struct nfs_args nfsdefargs = {

View File

@ -151,7 +151,7 @@ struct mntopt mopts[] = {
{ "lockd", 1, ALTF_NOLOCKD, 1 },
{ "inet4", 1, ALTF_NOINET4, 1 },
{ "inet6", 1, ALTF_NOINET6, 1 },
{ NULL }
MOPT_NULL
};
struct nfs_args nfsdefargs = {

View File

@ -58,7 +58,7 @@
static struct mntopt mopts[] = {
MOPT_STDOPTS,
{ NULL }
MOPT_NULL
};
static gid_t a_gid(char *);

View File

@ -59,7 +59,7 @@ static const char rcsid[] =
struct mntopt mopts[] = {
MOPT_STDOPTS,
{ NULL }
MOPT_NULL
};
int subdir(const char *, const char *);

View File

@ -41,7 +41,7 @@
struct mntopt mopts[] = {
MOPT_STDOPTS,
{ NULL }
MOPT_NULL
};
void usage(void);

View File

@ -59,7 +59,7 @@ static const char rcsid[] =
static struct mntopt mopts[] = {
MOPT_STDOPTS,
{ NULL }
MOPT_NULL
};
static char *fsname;

View File

@ -64,7 +64,7 @@
struct mntopt mopts[] = {
MOPT_STDOPTS,
MOPT_UPDATE,
{ NULL, 0, 0, 0 }
MOPT_NULL
};
int set_charset(char **, char **, const char *);

View File

@ -61,7 +61,7 @@ struct mntopt mopts[] = {
MOPT_SYNC,
MOPT_UPDATE,
MOPT_SNAPSHOT,
{ NULL }
MOPT_NULL
};
void usage(void);

View File

@ -79,7 +79,7 @@ static const char rcsid[] =
static struct mntopt mopts[] = {
MOPT_STDOPTS,
{ NULL }
MOPT_NULL
};
static void usage(void) __dead2;

View File

@ -60,7 +60,7 @@ static const char rcsid[] =
static struct mntopt mopts[] = {
MOPT_STDOPTS,
{ NULL }
MOPT_NULL
};
static int subdir(const char *, const char *);