diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2009-11-25 14:52:47 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2009-11-25 14:52:47 +0100 |
commit | b2e5fc35ebc127e2a1ac03c7ff0719b1e6b6cd6b (patch) | |
tree | 21c86016df03253513c3bbe80fc7eef71b209d68 /util-linux/mount.c | |
parent | 18221506e5aeb9c279b73bc9418b60c75b10399a (diff) | |
download | busybox-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.c | 10 |
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. |
1804 | static const char must_be_root[] ALIGN1 = "you must be root"; | ||
1805 | |||
1806 | int mount_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; | 1804 | int mount_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; |
1807 | int mount_main(int argc UNUSED_PARAM, char **argv) | 1805 | int 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 |