diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2007-06-25 10:55:35 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2007-06-25 10:55:35 +0000 |
commit | 80b8b39899a09c7516920cda5fd343b3086d4824 (patch) | |
tree | aa9903fd6b64d19c5f640fa302272d85c92b204e /util-linux/mount.c | |
parent | 1399282b47bb218132a554cbe5b2b0ce4dcc055f (diff) | |
download | busybox-w32-80b8b39899a09c7516920cda5fd343b3086d4824.tar.gz busybox-w32-80b8b39899a09c7516920cda5fd343b3086d4824.tar.bz2 busybox-w32-80b8b39899a09c7516920cda5fd343b3086d4824.zip |
Consolidate ARRAY_SIZE macro; remove one unneeded global var (walter harms <wharms@bfs.de>)
Diffstat (limited to '')
-rw-r--r-- | util-linux/mount.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/util-linux/mount.c b/util-linux/mount.c index fe2f1d969..4dd1a85a2 100644 --- a/util-linux/mount.c +++ b/util-linux/mount.c | |||
@@ -120,7 +120,6 @@ struct { | |||
120 | {"remount", MS_REMOUNT}, // action flag | 120 | {"remount", MS_REMOUNT}, // action flag |
121 | }; | 121 | }; |
122 | 122 | ||
123 | #define VECTOR_SIZE(v) (sizeof(v) / sizeof((v)[0])) | ||
124 | 123 | ||
125 | /* Append mount options to string */ | 124 | /* Append mount options to string */ |
126 | static void append_mount_options(char **oldopts, const char *newopts) | 125 | static void append_mount_options(char **oldopts, const char *newopts) |
@@ -168,7 +167,7 @@ static int parse_mount_options(char *options, char **unrecognized) | |||
168 | if (comma) *comma = 0; | 167 | if (comma) *comma = 0; |
169 | 168 | ||
170 | // Find this option in mount_options | 169 | // Find this option in mount_options |
171 | for (i = 0; i < VECTOR_SIZE(mount_options); i++) { | 170 | for (i = 0; i < ARRAY_SIZE(mount_options); i++) { |
172 | if (!strcasecmp(mount_options[i].name, options)) { | 171 | if (!strcasecmp(mount_options[i].name, options)) { |
173 | long fl = mount_options[i].flags; | 172 | long fl = mount_options[i].flags; |
174 | if (fl < 0) flags &= fl; | 173 | if (fl < 0) flags &= fl; |
@@ -177,7 +176,7 @@ static int parse_mount_options(char *options, char **unrecognized) | |||
177 | } | 176 | } |
178 | } | 177 | } |
179 | // If unrecognized not NULL, append unrecognized mount options */ | 178 | // If unrecognized not NULL, append unrecognized mount options */ |
180 | if (unrecognized && i == VECTOR_SIZE(mount_options)) { | 179 | if (unrecognized && i == ARRAY_SIZE(mount_options)) { |
181 | // Add it to strflags, to pass on to kernel | 180 | // Add it to strflags, to pass on to kernel |
182 | i = *unrecognized ? strlen(*unrecognized) : 0; | 181 | i = *unrecognized ? strlen(*unrecognized) : 0; |
183 | *unrecognized = xrealloc(*unrecognized, i+strlen(options)+2); | 182 | *unrecognized = xrealloc(*unrecognized, i+strlen(options)+2); |