diff options
Diffstat (limited to 'mount.c')
-rw-r--r-- | mount.c | 25 |
1 files changed, 15 insertions, 10 deletions
@@ -98,6 +98,7 @@ parse_mount_options ( char *options, unsigned long *flags, char *strflags) | |||
98 | 98 | ||
99 | while (f->name != 0) { | 99 | while (f->name != 0) { |
100 | if (strcasecmp (f->name, options) == 0) { | 100 | if (strcasecmp (f->name, options) == 0) { |
101 | |||
101 | *flags &= f->and; | 102 | *flags &= f->and; |
102 | *flags |= f->or; | 103 | *flags |= f->or; |
103 | gotone=TRUE; | 104 | gotone=TRUE; |
@@ -238,7 +239,7 @@ extern int mount_main (int argc, char **argv) | |||
238 | flags &= ~MS_RDONLY; | 239 | flags &= ~MS_RDONLY; |
239 | break; | 240 | break; |
240 | case 'a': | 241 | case 'a': |
241 | all = 1; | 242 | all = TRUE; |
242 | break; | 243 | break; |
243 | case 'v': | 244 | case 'v': |
244 | case 'h': | 245 | case 'h': |
@@ -261,7 +262,8 @@ extern int mount_main (int argc, char **argv) | |||
261 | argv++; | 262 | argv++; |
262 | } | 263 | } |
263 | 264 | ||
264 | if (all == 1) { | 265 | if (all == TRUE) { |
266 | long newFlags; | ||
265 | struct mntent *m; | 267 | struct mntent *m; |
266 | FILE *f = setmntent ("/etc/fstab", "r"); | 268 | FILE *f = setmntent ("/etc/fstab", "r"); |
267 | 269 | ||
@@ -270,14 +272,17 @@ extern int mount_main (int argc, char **argv) | |||
270 | exit( FALSE); | 272 | exit( FALSE); |
271 | } | 273 | } |
272 | while ((m = getmntent (f)) != NULL) { | 274 | while ((m = getmntent (f)) != NULL) { |
273 | // If the file system isn't noauto, and isn't mounted on /, mount | 275 | // If the file system isn't noauto, and isn't mounted on /, |
274 | // it | 276 | // and isn't swap or nfs, then mount it |
275 | if ((!strstr (m->mnt_opts, "noauto")) | 277 | if ((!strstr (m->mnt_opts, "noauto")) && |
276 | && (m->mnt_dir[1] != '\0') && !((m->mnt_type[0] == 's') | 278 | (m->mnt_dir[1] != '\0') && |
277 | && (m->mnt_type[1] == 'w')) | 279 | (!strstr (m->mnt_type, "swap")) && |
278 | && !((m->mnt_type[0] == 'n') && (m->mnt_type[1] == 'f'))) { | 280 | (!strstr (m->mnt_type, "nfs"))) |
279 | mount_one (m->mnt_fsname, m->mnt_dir, m->mnt_type, flags, | 281 | { |
280 | m->mnt_opts); | 282 | newFlags = flags; |
283 | *string_flags = '\0'; | ||
284 | parse_mount_options(m->mnt_opts, &newFlags, string_flags); | ||
285 | mount_one (m->mnt_fsname, m->mnt_dir, m->mnt_type, newFlags, string_flags); | ||
281 | } | 286 | } |
282 | } | 287 | } |
283 | endmntent (f); | 288 | endmntent (f); |