aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2006-09-24 01:01:01 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2006-09-24 01:01:01 +0000
commitda3cec9c850450c89081145c6943ee615639d1ae (patch)
treed36ecb9df286bbc107172d39104f9e11eb83b9b6
parent29d94b907f8e1849385e9a2ac5e286c5c2d40936 (diff)
downloadbusybox-w32-da3cec9c850450c89081145c6943ee615639d1ae.tar.gz
busybox-w32-da3cec9c850450c89081145c6943ee615639d1ae.tar.bz2
busybox-w32-da3cec9c850450c89081145c6943ee615639d1ae.zip
mount: fix breakage from recent changes (spurious -ro mounts)
-rw-r--r--util-linux/mount.c30
1 files changed, 11 insertions, 19 deletions
diff --git a/util-linux/mount.c b/util-linux/mount.c
index 35776e3e0..3daab2831 100644
--- a/util-linux/mount.c
+++ b/util-linux/mount.c
@@ -9,10 +9,6 @@
9 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. 9 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
10 */ 10 */
11 11
12/* todo:
13 * bb_getopt_ulflags();
14 */
15
16/* Design notes: There is no spec for mount. Remind me to write one. 12/* Design notes: There is no spec for mount. Remind me to write one.
17 13
18 mount_main() calls singlemount() which calls mount_it_now(). 14 mount_main() calls singlemount() which calls mount_it_now().
@@ -1427,7 +1423,7 @@ report_error:
1427 1423
1428int mount_main(int argc, char **argv) 1424int mount_main(int argc, char **argv)
1429{ 1425{
1430 enum { OPT_ALL = 0x8 }; 1426 enum { OPT_ALL = 0x10 };
1431 1427
1432 char *cmdopts = xstrdup(""), *fstype=0, *storage_path=0; 1428 char *cmdopts = xstrdup(""), *fstype=0, *storage_path=0;
1433 char *opt_o; 1429 char *opt_o;
@@ -1445,24 +1441,20 @@ int mount_main(int argc, char **argv)
1445 append_mount_options(&cmdopts,argv[i]+2); 1441 append_mount_options(&cmdopts,argv[i]+2);
1446 } else argv[j++] = argv[i]; 1442 } else argv[j++] = argv[i];
1447 } 1443 }
1444 argv[j] = 0;
1448 argc = j; 1445 argc = j;
1449 1446
1450 // Parse remaining options 1447 // Parse remaining options
1451 1448
1452 opt = bb_getopt_ulflags(argc, argv, "o:t:rwavnf", &opt_o, &fstype); 1449 opt = bb_getopt_ulflags(argc, argv, "o:t:rwanfv", &opt_o, &fstype);
1453 if (opt & 1) // -o 1450 if (opt & 0x1) append_mount_options(&cmdopts, opt_o); // -o
1454 append_mount_options(&cmdopts, opt_o); 1451 //if (opt & 0x2) // -t
1455 //if (opt & 1) // -t 1452 if (opt & 0x4) append_mount_options(&cmdopts, "ro"); // -r
1456 if (opt & 2) // -r 1453 if (opt & 0x8) append_mount_options(&cmdopts, "rw"); // -w
1457 append_mount_options(&cmdopts, "ro"); 1454 //if (opt & 0x10) // -a
1458 if (opt & 4) // -w 1455 if (opt & 0x20) USE_FEATURE_MTAB_SUPPORT(useMtab = FALSE); // -n
1459 append_mount_options(&cmdopts, "rw"); 1456 if (opt & 0x40) USE_FEATURE_MTAB_SUPPORT(fakeIt = FALSE); // -f
1460 //if (opt & 8) // -a 1457 //if (opt & 0x80) // -v: ignore
1461 if (opt & 0x10) // -n
1462 USE_FEATURE_MTAB_SUPPORT(useMtab = FALSE);
1463 if (opt & 0x20) // -f
1464 USE_FEATURE_MTAB_SUPPORT(fakeIt = FALSE);
1465 //if (opt & 0x40) // ignore -v
1466 argv += optind; 1458 argv += optind;
1467 argc -= optind; 1459 argc -= optind;
1468 1460