summaryrefslogtreecommitdiff
path: root/util-linux/mount.c
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2009-11-25 14:52:47 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2009-11-25 14:52:47 +0100
commitb2e5fc35ebc127e2a1ac03c7ff0719b1e6b6cd6b (patch)
tree21c86016df03253513c3bbe80fc7eef71b209d68 /util-linux/mount.c
parent18221506e5aeb9c279b73bc9418b60c75b10399a (diff)
downloadbusybox-w32-b2e5fc35ebc127e2a1ac03c7ff0719b1e6b6cd6b.tar.gz
busybox-w32-b2e5fc35ebc127e2a1ac03c7ff0719b1e6b6cd6b.tar.bz2
busybox-w32-b2e5fc35ebc127e2a1ac03c7ff0719b1e6b6cd6b.zip
ntpd: and real handling for -N, show usage w/o options; trim text
function old new delta ntp_init 317 348 +31 bb_msg_you_must_be_root - 17 +17 xsocket 66 76 +10 changepath 195 194 -1 bb_msg_perm_denied_are_you_root 35 34 -1 send_tree 355 353 -2 count_lines 74 72 -2 must_be_root 17 - -17 ------------------------------------------------------------------------------ (add/remove: 1/1 grow/shrink: 2/4 up/down: 58/-23) Total: 35 bytes text data bss dec hexfilename 832873 441 7548 840862 cd49ebusybox_old 832839 441 7548 840828 cd47cbusybox_unstripped Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'util-linux/mount.c')
-rw-r--r--util-linux/mount.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/util-linux/mount.c b/util-linux/mount.c
index 271e691e7..d27d65f80 100644
--- a/util-linux/mount.c
+++ b/util-linux/mount.c
@@ -1801,8 +1801,6 @@ static int match_opt(const char *fs_opt, const char *O_opt)
1801 1801
1802// Parse options, if necessary parse fstab/mtab, and call singlemount for 1802// Parse options, if necessary parse fstab/mtab, and call singlemount for
1803// each directory to be mounted. 1803// each directory to be mounted.
1804static const char must_be_root[] ALIGN1 = "you must be root";
1805
1806int mount_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 1804int mount_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
1807int mount_main(int argc UNUSED_PARAM, char **argv) 1805int mount_main(int argc UNUSED_PARAM, char **argv)
1808{ 1806{
@@ -1871,7 +1869,7 @@ int mount_main(int argc UNUSED_PARAM, char **argv)
1871 // argument when we get it. 1869 // argument when we get it.
1872 if (argv[1]) { 1870 if (argv[1]) {
1873 if (nonroot) 1871 if (nonroot)
1874 bb_error_msg_and_die(must_be_root); 1872 bb_error_msg_and_die(bb_msg_you_must_be_root);
1875 mtpair->mnt_fsname = argv[0]; 1873 mtpair->mnt_fsname = argv[0];
1876 mtpair->mnt_dir = argv[1]; 1874 mtpair->mnt_dir = argv[1];
1877 mtpair->mnt_type = fstype; 1875 mtpair->mnt_type = fstype;
@@ -1888,7 +1886,7 @@ int mount_main(int argc UNUSED_PARAM, char **argv)
1888 1886
1889 i = parse_mount_options(cmdopts, NULL); // FIXME: should be "long", not "int" 1887 i = parse_mount_options(cmdopts, NULL); // FIXME: should be "long", not "int"
1890 if (nonroot && (i & ~MS_SILENT)) // Non-root users cannot specify flags 1888 if (nonroot && (i & ~MS_SILENT)) // Non-root users cannot specify flags
1891 bb_error_msg_and_die(must_be_root); 1889 bb_error_msg_and_die(bb_msg_you_must_be_root);
1892 1890
1893 // If we have a shared subtree flag, don't worry about fstab or mtab. 1891 // If we have a shared subtree flag, don't worry about fstab or mtab.
1894 if (ENABLE_FEATURE_MOUNT_FLAGS 1892 if (ENABLE_FEATURE_MOUNT_FLAGS
@@ -1947,7 +1945,7 @@ int mount_main(int argc UNUSED_PARAM, char **argv)
1947 // No, mount -a won't mount anything, 1945 // No, mount -a won't mount anything,
1948 // even user mounts, for mere humans 1946 // even user mounts, for mere humans
1949 if (nonroot) 1947 if (nonroot)
1950 bb_error_msg_and_die(must_be_root); 1948 bb_error_msg_and_die(bb_msg_you_must_be_root);
1951 1949
1952 // Does type match? (NULL matches always) 1950 // Does type match? (NULL matches always)
1953 if (!match_fstype(mtcur, fstype)) 1951 if (!match_fstype(mtcur, fstype))
@@ -2012,7 +2010,7 @@ int mount_main(int argc UNUSED_PARAM, char **argv)
2012 // fstab must have "users" or "user" 2010 // fstab must have "users" or "user"
2013 l = parse_mount_options(mtcur->mnt_opts, NULL); 2011 l = parse_mount_options(mtcur->mnt_opts, NULL);
2014 if (!(l & MOUNT_USERS)) 2012 if (!(l & MOUNT_USERS))
2015 bb_error_msg_and_die(must_be_root); 2013 bb_error_msg_and_die(bb_msg_you_must_be_root);
2016 } 2014 }
2017 2015
2018 // Mount the last thing we found 2016 // Mount the last thing we found