From 73ac45052f0c9d5ff55352ce80a0cec86b831908 Mon Sep 17 00:00:00 2001 From: Xin LI Date: Wed, 1 Jun 2005 09:39:36 +0000 Subject: [PATCH] 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. --- sbin/mount/mntopts.h | 3 +++ sbin/mount/mount_ufs.c | 2 +- sbin/mount_cd9660/mount_cd9660.c | 2 +- sbin/mount_ext2fs/mount_ext2fs.c | 2 +- sbin/mount_hpfs/mount_hpfs.c | 2 +- sbin/mount_msdosfs/mount_msdosfs.c | 2 +- sbin/mount_nfs/mount_nfs.c | 2 +- sbin/mount_nfs4/mount_nfs4.c | 2 +- sbin/mount_ntfs/mount_ntfs.c | 2 +- sbin/mount_nullfs/mount_nullfs.c | 2 +- sbin/mount_reiserfs/mount_reiserfs.c | 2 +- sbin/mount_std/mount_std.c | 2 +- sbin/mount_udf/mount_udf.c | 2 +- sbin/mount_ufs/mount_ufs.c | 2 +- sbin/mount_umapfs/mount_umapfs.c | 2 +- sbin/mount_unionfs/mount_unionfs.c | 2 +- 16 files changed, 18 insertions(+), 15 deletions(-) diff --git a/sbin/mount/mntopts.h b/sbin/mount/mntopts.h index 5205195fd3f1..8b8e1fbf5ce8 100644 --- a/sbin/mount/mntopts.h +++ b/sbin/mount/mntopts.h @@ -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, \ diff --git a/sbin/mount/mount_ufs.c b/sbin/mount/mount_ufs.c index ff1c126b6390..e18247b23860 100644 --- a/sbin/mount/mount_ufs.c +++ b/sbin/mount/mount_ufs.c @@ -64,7 +64,7 @@ static struct mntopt mopts[] = { MOPT_SYNC, MOPT_UPDATE, MOPT_SNAPSHOT, - { NULL } + MOPT_NULL }; int diff --git a/sbin/mount_cd9660/mount_cd9660.c b/sbin/mount_cd9660/mount_cd9660.c index a1a11f986fe2..4a6461a6b64d 100644 --- a/sbin/mount_cd9660/mount_cd9660.c +++ b/sbin/mount_cd9660/mount_cd9660.c @@ -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); diff --git a/sbin/mount_ext2fs/mount_ext2fs.c b/sbin/mount_ext2fs/mount_ext2fs.c index 4c7c401821fc..a74a5d72fdf4 100644 --- a/sbin/mount_ext2fs/mount_ext2fs.c +++ b/sbin/mount_ext2fs/mount_ext2fs.c @@ -60,7 +60,7 @@ struct mntopt mopts[] = { MOPT_FORCE, MOPT_SYNC, MOPT_UPDATE, - { NULL } + MOPT_NULL }; static void usage(void) __dead2; diff --git a/sbin/mount_hpfs/mount_hpfs.c b/sbin/mount_hpfs/mount_hpfs.c index 95986f13fa0b..150dfd1313a6 100644 --- a/sbin/mount_hpfs/mount_hpfs.c +++ b/sbin/mount_hpfs/mount_hpfs.c @@ -50,7 +50,7 @@ static struct mntopt mopts[] = { MOPT_STDOPTS, - { NULL } + MOPT_NULL }; static gid_t a_gid(char *); diff --git a/sbin/mount_msdosfs/mount_msdosfs.c b/sbin/mount_msdosfs/mount_msdosfs.c index 58551d37e212..d5557bba4f5c 100644 --- a/sbin/mount_msdosfs/mount_msdosfs.c +++ b/sbin/mount_msdosfs/mount_msdosfs.c @@ -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 *); diff --git a/sbin/mount_nfs/mount_nfs.c b/sbin/mount_nfs/mount_nfs.c index 0e9957722a08..4af2d6595586 100644 --- a/sbin/mount_nfs/mount_nfs.c +++ b/sbin/mount_nfs/mount_nfs.c @@ -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 = { diff --git a/sbin/mount_nfs4/mount_nfs4.c b/sbin/mount_nfs4/mount_nfs4.c index b1ad123a446a..683fb93276ab 100644 --- a/sbin/mount_nfs4/mount_nfs4.c +++ b/sbin/mount_nfs4/mount_nfs4.c @@ -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 = { diff --git a/sbin/mount_ntfs/mount_ntfs.c b/sbin/mount_ntfs/mount_ntfs.c index 54bb38e0d424..49db87dc92e7 100644 --- a/sbin/mount_ntfs/mount_ntfs.c +++ b/sbin/mount_ntfs/mount_ntfs.c @@ -58,7 +58,7 @@ static struct mntopt mopts[] = { MOPT_STDOPTS, - { NULL } + MOPT_NULL }; static gid_t a_gid(char *); diff --git a/sbin/mount_nullfs/mount_nullfs.c b/sbin/mount_nullfs/mount_nullfs.c index 0c947a923ecb..8fefe1616952 100644 --- a/sbin/mount_nullfs/mount_nullfs.c +++ b/sbin/mount_nullfs/mount_nullfs.c @@ -59,7 +59,7 @@ static const char rcsid[] = struct mntopt mopts[] = { MOPT_STDOPTS, - { NULL } + MOPT_NULL }; int subdir(const char *, const char *); diff --git a/sbin/mount_reiserfs/mount_reiserfs.c b/sbin/mount_reiserfs/mount_reiserfs.c index 90f873109333..34dc46353c48 100644 --- a/sbin/mount_reiserfs/mount_reiserfs.c +++ b/sbin/mount_reiserfs/mount_reiserfs.c @@ -41,7 +41,7 @@ struct mntopt mopts[] = { MOPT_STDOPTS, - { NULL } + MOPT_NULL }; void usage(void); diff --git a/sbin/mount_std/mount_std.c b/sbin/mount_std/mount_std.c index 11f42c16e44a..601cab4b1a24 100644 --- a/sbin/mount_std/mount_std.c +++ b/sbin/mount_std/mount_std.c @@ -59,7 +59,7 @@ static const char rcsid[] = static struct mntopt mopts[] = { MOPT_STDOPTS, - { NULL } + MOPT_NULL }; static char *fsname; diff --git a/sbin/mount_udf/mount_udf.c b/sbin/mount_udf/mount_udf.c index 080fab8d1999..4c8dbef59ac8 100644 --- a/sbin/mount_udf/mount_udf.c +++ b/sbin/mount_udf/mount_udf.c @@ -64,7 +64,7 @@ struct mntopt mopts[] = { MOPT_STDOPTS, MOPT_UPDATE, - { NULL, 0, 0, 0 } + MOPT_NULL }; int set_charset(char **, char **, const char *); diff --git a/sbin/mount_ufs/mount_ufs.c b/sbin/mount_ufs/mount_ufs.c index ff8ab9dd716e..6043b1f049cd 100644 --- a/sbin/mount_ufs/mount_ufs.c +++ b/sbin/mount_ufs/mount_ufs.c @@ -61,7 +61,7 @@ struct mntopt mopts[] = { MOPT_SYNC, MOPT_UPDATE, MOPT_SNAPSHOT, - { NULL } + MOPT_NULL }; void usage(void); diff --git a/sbin/mount_umapfs/mount_umapfs.c b/sbin/mount_umapfs/mount_umapfs.c index c7315be9a3c9..eb932fa6802e 100644 --- a/sbin/mount_umapfs/mount_umapfs.c +++ b/sbin/mount_umapfs/mount_umapfs.c @@ -79,7 +79,7 @@ static const char rcsid[] = static struct mntopt mopts[] = { MOPT_STDOPTS, - { NULL } + MOPT_NULL }; static void usage(void) __dead2; diff --git a/sbin/mount_unionfs/mount_unionfs.c b/sbin/mount_unionfs/mount_unionfs.c index 6d67bef9b499..9c541c6d37af 100644 --- a/sbin/mount_unionfs/mount_unionfs.c +++ b/sbin/mount_unionfs/mount_unionfs.c @@ -60,7 +60,7 @@ static const char rcsid[] = static struct mntopt mopts[] = { MOPT_STDOPTS, - { NULL } + MOPT_NULL }; static int subdir(const char *, const char *);