diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2009-08-02 20:18:29 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2009-08-02 20:18:29 +0200 |
commit | 4cd4eb43320de6ecccb3b69087daee325d0bbfc1 (patch) | |
tree | 44db952d0feea229c4359bd5a2f8dc59db5ee07d | |
parent | 6a98f95373d60d48001299797f52b1f19c7ffecd (diff) | |
download | busybox-w32-4cd4eb43320de6ecccb3b69087daee325d0bbfc1.tar.gz busybox-w32-4cd4eb43320de6ecccb3b69087daee325d0bbfc1.tar.bz2 busybox-w32-4cd4eb43320de6ecccb3b69087daee325d0bbfc1.zip |
apply post-1.14.2 patches
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | coreutils/df.c | 7 | ||||
-rw-r--r-- | coreutils/ls.c | 63 | ||||
-rw-r--r-- | coreutils/test.c | 13 | ||||
-rw-r--r-- | include/applets.h | 2 | ||||
-rw-r--r-- | include/libbb.h | 2 | ||||
-rw-r--r-- | libbb/find_mount_point.c | 22 | ||||
-rw-r--r-- | networking/udhcp/files.c | 2 | ||||
-rw-r--r-- | testsuite/ls/ls-1-works | 6 | ||||
-rw-r--r-- | testsuite/ls/ls-h-works | 6 | ||||
-rw-r--r-- | testsuite/ls/ls-l-works | 4 | ||||
-rw-r--r-- | testsuite/ls/ls-s-works | 4 | ||||
-rwxr-xr-x | testsuite/test.tests | 10 | ||||
-rw-r--r-- | util-linux/mkfs_minix.c | 8 | ||||
-rw-r--r-- | util-linux/mkfs_vfat.c | 6 |
14 files changed, 99 insertions, 56 deletions
diff --git a/coreutils/df.c b/coreutils/df.c index dfd6e0b41..e9a865c19 100644 --- a/coreutils/df.c +++ b/coreutils/df.c | |||
@@ -44,7 +44,6 @@ int df_main(int argc, char **argv) | |||
44 | FILE *mount_table; | 44 | FILE *mount_table; |
45 | struct mntent *mount_entry; | 45 | struct mntent *mount_entry; |
46 | struct statfs s; | 46 | struct statfs s; |
47 | static const char ignored_mounts[] ALIGN1 = "rootfs\0"; | ||
48 | 47 | ||
49 | enum { | 48 | enum { |
50 | OPT_KILO = (1 << 0), | 49 | OPT_KILO = (1 << 0), |
@@ -120,7 +119,7 @@ int df_main(int argc, char **argv) | |||
120 | mount_point = *argv++; | 119 | mount_point = *argv++; |
121 | if (!mount_point) | 120 | if (!mount_point) |
122 | break; | 121 | break; |
123 | mount_entry = find_mount_point(mount_point, bb_path_mtab_file); | 122 | mount_entry = find_mount_point(mount_point); |
124 | if (!mount_entry) { | 123 | if (!mount_entry) { |
125 | bb_error_msg("%s: can't find mount point", mount_point); | 124 | bb_error_msg("%s: can't find mount point", mount_point); |
126 | set_error: | 125 | set_error: |
@@ -154,8 +153,8 @@ int df_main(int argc, char **argv) | |||
154 | ) / (blocks_used + s.f_bavail); | 153 | ) / (blocks_used + s.f_bavail); |
155 | } | 154 | } |
156 | 155 | ||
157 | /* GNU coreutils 6.10 skip certain mounts, try to be compatible. */ | 156 | /* GNU coreutils 6.10 skips certain mounts, try to be compatible. */ |
158 | if (index_in_strings(device, ignored_mounts) != -1) | 157 | if (strcmp(device, "rootfs") == 0) |
159 | continue; | 158 | continue; |
160 | 159 | ||
161 | #ifdef WHY_WE_DO_IT_FOR_DEV_ROOT_ONLY | 160 | #ifdef WHY_WE_DO_IT_FOR_DEV_ROOT_ONLY |
diff --git a/coreutils/ls.c b/coreutils/ls.c index 61baa9a11..38957e93d 100644 --- a/coreutils/ls.c +++ b/coreutils/ls.c | |||
@@ -144,8 +144,7 @@ static const char ls_options[] ALIGN1 = | |||
144 | USE_FEATURE_LS_FOLLOWLINKS("L") /* 1, 24 */ | 144 | USE_FEATURE_LS_FOLLOWLINKS("L") /* 1, 24 */ |
145 | USE_FEATURE_LS_RECURSIVE("R") /* 1, 25 */ | 145 | USE_FEATURE_LS_RECURSIVE("R") /* 1, 25 */ |
146 | USE_FEATURE_HUMAN_READABLE("h") /* 1, 26 */ | 146 | USE_FEATURE_HUMAN_READABLE("h") /* 1, 26 */ |
147 | USE_SELINUX("K") /* 1, 27 */ | 147 | USE_SELINUX("KZ") /* 2, 28 */ |
148 | USE_SELINUX("Z") /* 1, 28 */ | ||
149 | USE_FEATURE_AUTOWIDTH("T:w:") /* 2, 30 */ | 148 | USE_FEATURE_AUTOWIDTH("T:w:") /* 2, 30 */ |
150 | ; | 149 | ; |
151 | enum { | 150 | enum { |
@@ -162,6 +161,16 @@ enum { | |||
162 | OPT_Q = (1 << 10), | 161 | OPT_Q = (1 << 10), |
163 | //OPT_A = (1 << 11), | 162 | //OPT_A = (1 << 11), |
164 | //OPT_k = (1 << 12), | 163 | //OPT_k = (1 << 12), |
164 | OPTBIT_color = 13 | ||
165 | + 4 * ENABLE_FEATURE_LS_TIMESTAMPS | ||
166 | + 4 * ENABLE_FEATURE_LS_SORTFILES | ||
167 | + 2 * ENABLE_FEATURE_LS_FILETYPES | ||
168 | + 1 * ENABLE_FEATURE_LS_FOLLOWLINKS | ||
169 | + 1 * ENABLE_FEATURE_LS_RECURSIVE | ||
170 | + 1 * ENABLE_FEATURE_HUMAN_READABLE | ||
171 | + 2 * ENABLE_SELINUX | ||
172 | + 2 * ENABLE_FEATURE_AUTOWIDTH, | ||
173 | OPT_color = 1 << OPTBIT_color, | ||
165 | }; | 174 | }; |
166 | 175 | ||
167 | enum { | 176 | enum { |
@@ -889,16 +898,6 @@ static int list_single(const struct dnode *dn) | |||
889 | } | 898 | } |
890 | 899 | ||
891 | 900 | ||
892 | /* colored LS support by JaWi, janwillem.janssen@lxtreme.nl */ | ||
893 | #if ENABLE_FEATURE_LS_COLOR | ||
894 | /* long option entry used only for --color, which has no short option | ||
895 | * equivalent */ | ||
896 | static const char ls_color_opt[] ALIGN1 = | ||
897 | "color\0" Optional_argument "\xff" /* no short equivalent */ | ||
898 | ; | ||
899 | #endif | ||
900 | |||
901 | |||
902 | int ls_main(int argc UNUSED_PARAM, char **argv) | 901 | int ls_main(int argc UNUSED_PARAM, char **argv) |
903 | { | 902 | { |
904 | struct dnode **dnd; | 903 | struct dnode **dnd; |
@@ -911,8 +910,25 @@ int ls_main(int argc UNUSED_PARAM, char **argv) | |||
911 | int dnfiles; | 910 | int dnfiles; |
912 | int dndirs; | 911 | int dndirs; |
913 | int i; | 912 | int i; |
913 | #if ENABLE_FEATURE_LS_COLOR | ||
914 | /* colored LS support by JaWi, janwillem.janssen@lxtreme.nl */ | ||
915 | /* coreutils 6.10: | ||
916 | * # ls --color=BOGUS | ||
917 | * ls: invalid argument 'BOGUS' for '--color' | ||
918 | * Valid arguments are: | ||
919 | * 'always', 'yes', 'force' | ||
920 | * 'never', 'no', 'none' | ||
921 | * 'auto', 'tty', 'if-tty' | ||
922 | * (and substrings: "--color=alwa" work too) | ||
923 | */ | ||
924 | static const char ls_longopts[] ALIGN1 = | ||
925 | "color\0" Optional_argument "\xff"; /* no short equivalent */ | ||
926 | static const char color_str[] ALIGN1 = | ||
927 | "always\0""yes\0""force\0" | ||
928 | "auto\0""tty\0""if-tty\0"; | ||
914 | /* need to initialize since --color has _an optional_ argument */ | 929 | /* need to initialize since --color has _an optional_ argument */ |
915 | USE_FEATURE_LS_COLOR(const char *color_opt = "always";) | 930 | const char *color_opt = color_str; /* "always" */ |
931 | #endif | ||
916 | 932 | ||
917 | INIT_G(); | 933 | INIT_G(); |
918 | 934 | ||
@@ -927,7 +943,7 @@ int ls_main(int argc UNUSED_PARAM, char **argv) | |||
927 | #endif | 943 | #endif |
928 | 944 | ||
929 | /* process options */ | 945 | /* process options */ |
930 | USE_FEATURE_LS_COLOR(applet_long_options = ls_color_opt;) | 946 | USE_FEATURE_LS_COLOR(applet_long_options = ls_longopts;) |
931 | #if ENABLE_FEATURE_AUTOWIDTH | 947 | #if ENABLE_FEATURE_AUTOWIDTH |
932 | opt_complementary = "T+:w+"; /* -T N, -w N */ | 948 | opt_complementary = "T+:w+"; /* -T N, -w N */ |
933 | opt = getopt32(argv, ls_options, &tabstops, &terminal_width | 949 | opt = getopt32(argv, ls_options, &tabstops, &terminal_width |
@@ -966,13 +982,20 @@ int ls_main(int argc UNUSED_PARAM, char **argv) | |||
966 | if (!p || (p[0] && strcmp(p, "none") != 0)) | 982 | if (!p || (p[0] && strcmp(p, "none") != 0)) |
967 | show_color = 1; | 983 | show_color = 1; |
968 | } | 984 | } |
969 | if (opt & (1 << i)) { /* next flag after short options */ | 985 | if (opt & OPT_color) { |
970 | if (strcmp("always", color_opt) == 0) | 986 | if (color_opt[0] == 'n') |
971 | show_color = 1; | ||
972 | else if (strcmp("never", color_opt) == 0) | ||
973 | show_color = 0; | 987 | show_color = 0; |
974 | else if (strcmp("auto", color_opt) == 0 && isatty(STDOUT_FILENO)) | 988 | else switch (index_in_substrings(color_str, color_opt)) { |
975 | show_color = 1; | 989 | case 3: |
990 | case 4: | ||
991 | case 5: | ||
992 | if (isatty(STDOUT_FILENO)) { | ||
993 | case 0: | ||
994 | case 1: | ||
995 | case 2: | ||
996 | show_color = 1; | ||
997 | } | ||
998 | } | ||
976 | } | 999 | } |
977 | #endif | 1000 | #endif |
978 | 1001 | ||
diff --git a/coreutils/test.c b/coreutils/test.c index ae40192a2..ab7b41684 100644 --- a/coreutils/test.c +++ b/coreutils/test.c | |||
@@ -571,7 +571,14 @@ static number_t nexpr(enum token n) | |||
571 | 571 | ||
572 | nest_msg(">nexpr(%s)\n", TOKSTR[n]); | 572 | nest_msg(">nexpr(%s)\n", TOKSTR[n]); |
573 | if (n == UNOT) { | 573 | if (n == UNOT) { |
574 | res = !nexpr(check_operator(*++args)); | 574 | n = check_operator(*++args); |
575 | if (n == EOI) { | ||
576 | /* special case: [ ! ], [ a -a ! ] are valid */ | ||
577 | /* IOW, "! ARG" may miss ARG */ | ||
578 | unnest_msg("<nexpr:1 (!EOI)\n"); | ||
579 | return 1; | ||
580 | } | ||
581 | res = !nexpr(n); | ||
575 | unnest_msg("<nexpr:%lld\n", res); | 582 | unnest_msg("<nexpr:%lld\n", res); |
576 | return res; | 583 | return res; |
577 | } | 584 | } |
@@ -742,7 +749,7 @@ int test_main(int argc, char **argv) | |||
742 | check_operator(argv[1]); | 749 | check_operator(argv[1]); |
743 | if (last_operator->op_type == BINOP) { | 750 | if (last_operator->op_type == BINOP) { |
744 | /* "test [!] arg1 <binary_op> arg2" */ | 751 | /* "test [!] arg1 <binary_op> arg2" */ |
745 | args = &argv[0]; | 752 | args = argv; |
746 | res = (binop() == 0); | 753 | res = (binop() == 0); |
747 | goto ret; | 754 | goto ret; |
748 | } | 755 | } |
@@ -755,7 +762,7 @@ int test_main(int argc, char **argv) | |||
755 | argv--; | 762 | argv--; |
756 | } | 763 | } |
757 | #endif | 764 | #endif |
758 | args = &argv[0]; | 765 | args = argv; |
759 | res = !oexpr(check_operator(*args)); | 766 | res = !oexpr(check_operator(*args)); |
760 | 767 | ||
761 | if (*args != NULL && *++args != NULL) { | 768 | if (*args != NULL && *++args != NULL) { |
diff --git a/include/applets.h b/include/applets.h index 1d932589b..32c596d6d 100644 --- a/include/applets.h +++ b/include/applets.h | |||
@@ -284,7 +284,7 @@ USE_PATCH(APPLET(patch, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) | |||
284 | USE_PGREP(APPLET(pgrep, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) | 284 | USE_PGREP(APPLET(pgrep, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) |
285 | USE_PIDOF(APPLET(pidof, _BB_DIR_BIN, _BB_SUID_NEVER)) | 285 | USE_PIDOF(APPLET(pidof, _BB_DIR_BIN, _BB_SUID_NEVER)) |
286 | USE_PING(APPLET(ping, _BB_DIR_BIN, _BB_SUID_MAYBE)) | 286 | USE_PING(APPLET(ping, _BB_DIR_BIN, _BB_SUID_MAYBE)) |
287 | USE_PING6(APPLET(ping6, _BB_DIR_BIN, _BB_SUID_NEVER)) | 287 | USE_PING6(APPLET(ping6, _BB_DIR_BIN, _BB_SUID_MAYBE)) |
288 | USE_PIPE_PROGRESS(APPLET(pipe_progress, _BB_DIR_BIN, _BB_SUID_NEVER)) | 288 | USE_PIPE_PROGRESS(APPLET(pipe_progress, _BB_DIR_BIN, _BB_SUID_NEVER)) |
289 | USE_PIVOT_ROOT(APPLET(pivot_root, _BB_DIR_SBIN, _BB_SUID_NEVER)) | 289 | USE_PIVOT_ROOT(APPLET(pivot_root, _BB_DIR_SBIN, _BB_SUID_NEVER)) |
290 | USE_PKILL(APPLET_ODDNAME(pkill, pgrep, _BB_DIR_USR_BIN, _BB_SUID_NEVER, pkill)) | 290 | USE_PKILL(APPLET_ODDNAME(pkill, pgrep, _BB_DIR_USR_BIN, _BB_SUID_NEVER, pkill)) |
diff --git a/include/libbb.h b/include/libbb.h index bedf659b7..2497ffe6a 100644 --- a/include/libbb.h +++ b/include/libbb.h | |||
@@ -1025,7 +1025,7 @@ extern void run_applet_no_and_exit(int a, char **argv) NORETURN FAST_FUNC; | |||
1025 | 1025 | ||
1026 | #ifdef HAVE_MNTENT_H | 1026 | #ifdef HAVE_MNTENT_H |
1027 | extern int match_fstype(const struct mntent *mt, const char *fstypes) FAST_FUNC; | 1027 | extern int match_fstype(const struct mntent *mt, const char *fstypes) FAST_FUNC; |
1028 | extern struct mntent *find_mount_point(const char *name, const char *table) FAST_FUNC; | 1028 | extern struct mntent *find_mount_point(const char *name) FAST_FUNC; |
1029 | #endif | 1029 | #endif |
1030 | extern void erase_mtab(const char * name) FAST_FUNC; | 1030 | extern void erase_mtab(const char * name) FAST_FUNC; |
1031 | extern unsigned int tty_baud_to_value(speed_t speed) FAST_FUNC; | 1031 | extern unsigned int tty_baud_to_value(speed_t speed) FAST_FUNC; |
diff --git a/libbb/find_mount_point.c b/libbb/find_mount_point.c index 4cd6b1618..12b2cfce4 100644 --- a/libbb/find_mount_point.c +++ b/libbb/find_mount_point.c | |||
@@ -17,7 +17,7 @@ | |||
17 | * Given any other file (or directory), find the mount table entry for its | 17 | * Given any other file (or directory), find the mount table entry for its |
18 | * filesystem. | 18 | * filesystem. |
19 | */ | 19 | */ |
20 | struct mntent* FAST_FUNC find_mount_point(const char *name, const char *table) | 20 | struct mntent* FAST_FUNC find_mount_point(const char *name) |
21 | { | 21 | { |
22 | struct stat s; | 22 | struct stat s; |
23 | dev_t mountDevice; | 23 | dev_t mountDevice; |
@@ -25,27 +25,35 @@ struct mntent* FAST_FUNC find_mount_point(const char *name, const char *table) | |||
25 | struct mntent *mountEntry; | 25 | struct mntent *mountEntry; |
26 | 26 | ||
27 | if (stat(name, &s) != 0) | 27 | if (stat(name, &s) != 0) |
28 | return 0; | 28 | return NULL; |
29 | 29 | ||
30 | if ((s.st_mode & S_IFMT) == S_IFBLK) | 30 | if (S_ISBLK(s.st_mode)) |
31 | mountDevice = s.st_rdev; | 31 | mountDevice = s.st_rdev; |
32 | else | 32 | else |
33 | mountDevice = s.st_dev; | 33 | mountDevice = s.st_dev; |
34 | 34 | ||
35 | 35 | ||
36 | mountTable = setmntent(table ? table : bb_path_mtab_file, "r"); | 36 | mountTable = setmntent(bb_path_mtab_file, "r"); |
37 | if (!mountTable) | 37 | if (!mountTable) |
38 | return 0; | 38 | return 0; |
39 | 39 | ||
40 | while ((mountEntry = getmntent(mountTable)) != 0) { | 40 | while ((mountEntry = getmntent(mountTable)) != NULL) { |
41 | /* rootfs mount in Linux 2.6 exists always, | ||
42 | * and it makes sense to always ignore it. | ||
43 | * Otherwise people can't reference their "real" root! */ | ||
44 | if (strcmp(mountEntry->mnt_fsname, "rootfs") == 0) | ||
45 | continue; | ||
46 | |||
41 | if (strcmp(name, mountEntry->mnt_dir) == 0 | 47 | if (strcmp(name, mountEntry->mnt_dir) == 0 |
42 | || strcmp(name, mountEntry->mnt_fsname) == 0 | 48 | || strcmp(name, mountEntry->mnt_fsname) == 0 |
43 | ) { /* String match. */ | 49 | ) { /* String match. */ |
44 | break; | 50 | break; |
45 | } | 51 | } |
46 | if (stat(mountEntry->mnt_fsname, &s) == 0 && s.st_rdev == mountDevice) /* Match the device. */ | 52 | /* Match the device. */ |
53 | if (stat(mountEntry->mnt_fsname, &s) == 0 && s.st_rdev == mountDevice) | ||
47 | break; | 54 | break; |
48 | if (stat(mountEntry->mnt_dir, &s) == 0 && s.st_dev == mountDevice) /* Match the directory's mount point. */ | 55 | /* Match the directory's mount point. */ |
56 | if (stat(mountEntry->mnt_dir, &s) == 0 && s.st_dev == mountDevice) | ||
49 | break; | 57 | break; |
50 | } | 58 | } |
51 | endmntent(mountTable); | 59 | endmntent(mountTable); |
diff --git a/networking/udhcp/files.c b/networking/udhcp/files.c index a061a9c9b..55f35978f 100644 --- a/networking/udhcp/files.c +++ b/networking/udhcp/files.c | |||
@@ -420,7 +420,7 @@ void FAST_FUNC read_leases(const char *file) | |||
420 | continue; | 420 | continue; |
421 | /* NB: add_lease takes "relative time", IOW, | 421 | /* NB: add_lease takes "relative time", IOW, |
422 | * lease duration, not lease deadline. */ | 422 | * lease duration, not lease deadline. */ |
423 | if (!(add_lease(lease.chaddr, lease.yiaddr, expires, lease.hostname))) { | 423 | if (!(add_lease(lease.chaddr, lease.yiaddr, expires, NULL /* was lease.hostname. bug in add_lease, disabled */ ))) { |
424 | bb_error_msg("too many leases while loading %s", file); | 424 | bb_error_msg("too many leases while loading %s", file); |
425 | break; | 425 | break; |
426 | } | 426 | } |
diff --git a/testsuite/ls/ls-1-works b/testsuite/ls/ls-1-works index 8ad484fc3..885694920 100644 --- a/testsuite/ls/ls-1-works +++ b/testsuite/ls/ls-1-works | |||
@@ -1,4 +1,4 @@ | |||
1 | [ -n "$d" ] || d=.. | 1 | [ -n "$d" ] || d=.. |
2 | ls -1 "$d" > logfile.gnu | 2 | LC_ALL=C ls -1 "$d" > logfile.gnu |
3 | busybox ls -1 "$d" > logfile.bb | 3 | LC_ALL=C busybox ls -1 "$d" > logfile.bb |
4 | cmp logfile.gnu logfile.bb | 4 | diff -ubw logfile.gnu logfile.bb |
diff --git a/testsuite/ls/ls-h-works b/testsuite/ls/ls-h-works index 7331262c9..0c83f7cc5 100644 --- a/testsuite/ls/ls-h-works +++ b/testsuite/ls/ls-h-works | |||
@@ -1,4 +1,4 @@ | |||
1 | [ -n "$d" ] || d=.. | 1 | [ -n "$d" ] || d=.. |
2 | ls -h "$d" > logfile.gnu | 2 | LC_ALL=C ls -h "$d" > logfile.gnu |
3 | busybox ls -h "$d" > logfile.bb | 3 | LC_ALL=C busybox ls -h "$d" > logfile.bb |
4 | cmp logfile.gnu logfile.bb | 4 | diff -ubw logfile.gnu logfile.bb |
diff --git a/testsuite/ls/ls-l-works b/testsuite/ls/ls-l-works index efc2b196e..1bad34bcf 100644 --- a/testsuite/ls/ls-l-works +++ b/testsuite/ls/ls-l-works | |||
@@ -1,4 +1,4 @@ | |||
1 | [ -n "$d" ] || d=.. | 1 | [ -n "$d" ] || d=.. |
2 | LC_ALL=C ls -l "$d" > logfile.gnu | 2 | LC_ALL=C ls -l "$d" > logfile.gnu |
3 | busybox ls -l "$d" > logfile.bb | 3 | LC_ALL=C busybox ls -l "$d" > logfile.bb |
4 | diff -w logfile.gnu logfile.bb | 4 | diff -ubw logfile.gnu logfile.bb |
diff --git a/testsuite/ls/ls-s-works b/testsuite/ls/ls-s-works index 6c8bf3627..0a9d7526f 100644 --- a/testsuite/ls/ls-s-works +++ b/testsuite/ls/ls-s-works | |||
@@ -1,4 +1,4 @@ | |||
1 | [ -n "$d" ] || d=.. | 1 | [ -n "$d" ] || d=.. |
2 | LC_ALL=C ls -1s "$d" > logfile.gnu | 2 | LC_ALL=C ls -1s "$d" > logfile.gnu |
3 | busybox ls -1s "$d" > logfile.bb | 3 | LC_ALL=C busybox ls -1s "$d" > logfile.bb |
4 | cmp logfile.gnu logfile.bb | 4 | diff -ubw logfile.gnu logfile.bb |
diff --git a/testsuite/test.tests b/testsuite/test.tests index d4be949ec..b7c84d9b2 100755 --- a/testsuite/test.tests +++ b/testsuite/test.tests | |||
@@ -21,6 +21,11 @@ testing "test '': should be false (1)" \ | |||
21 | "1\n" \ | 21 | "1\n" \ |
22 | "" "" | 22 | "" "" |
23 | 23 | ||
24 | testing "test !: should be true (0)" \ | ||
25 | "busybox test !; echo \$?" \ | ||
26 | "0\n" \ | ||
27 | "" "" | ||
28 | |||
24 | testing "test a: should be true (0)" \ | 29 | testing "test a: should be true (0)" \ |
25 | "busybox test a; echo \$?" \ | 30 | "busybox test a; echo \$?" \ |
26 | "0\n" \ | 31 | "0\n" \ |
@@ -51,6 +56,11 @@ testing "test -lt = -gt: should be false (1)" \ | |||
51 | "1\n" \ | 56 | "1\n" \ |
52 | "" "" | 57 | "" "" |
53 | 58 | ||
59 | testing "test a -a !: should be true (0)" \ | ||
60 | "busybox test a -a !; echo \$?" \ | ||
61 | "0\n" \ | ||
62 | "" "" | ||
63 | |||
54 | testing "test -f = a -o b: should be true (0)" \ | 64 | testing "test -f = a -o b: should be true (0)" \ |
55 | "busybox test -f = a -o b; echo \$?" \ | 65 | "busybox test -f = a -o b; echo \$?" \ |
56 | "0\n" \ | 66 | "0\n" \ |
diff --git a/util-linux/mkfs_minix.c b/util-linux/mkfs_minix.c index 2666132f9..18512a395 100644 --- a/util-linux/mkfs_minix.c +++ b/util-linux/mkfs_minix.c | |||
@@ -624,7 +624,6 @@ static void setup_tables(void) | |||
624 | int mkfs_minix_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; | 624 | int mkfs_minix_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; |
625 | int mkfs_minix_main(int argc UNUSED_PARAM, char **argv) | 625 | int mkfs_minix_main(int argc UNUSED_PARAM, char **argv) |
626 | { | 626 | { |
627 | struct mntent *mp; | ||
628 | unsigned opt; | 627 | unsigned opt; |
629 | char *tmp; | 628 | char *tmp; |
630 | struct stat statbuf; | 629 | struct stat statbuf; |
@@ -683,11 +682,8 @@ int mkfs_minix_main(int argc UNUSED_PARAM, char **argv) | |||
683 | G.total_blocks = 65535; | 682 | G.total_blocks = 65535; |
684 | 683 | ||
685 | /* Check if it is mounted */ | 684 | /* Check if it is mounted */ |
686 | mp = find_mount_point(G.device_name, NULL); | 685 | if (find_mount_point(G.device_name)) |
687 | if (mp && strcmp(G.device_name, mp->mnt_fsname) == 0) | 686 | bb_error_msg_and_die("can't format mounted filesystem"); |
688 | bb_error_msg_and_die("%s is mounted on %s; " | ||
689 | "refusing to make a filesystem", | ||
690 | G.device_name, mp->mnt_dir); | ||
691 | 687 | ||
692 | xmove_fd(xopen(G.device_name, O_RDWR), dev_fd); | 688 | xmove_fd(xopen(G.device_name, O_RDWR), dev_fd); |
693 | if (fstat(dev_fd, &statbuf) < 0) | 689 | if (fstat(dev_fd, &statbuf) < 0) |
diff --git a/util-linux/mkfs_vfat.c b/util-linux/mkfs_vfat.c index 72c2058b5..aa6ae92db 100644 --- a/util-linux/mkfs_vfat.c +++ b/util-linux/mkfs_vfat.c | |||
@@ -273,10 +273,10 @@ int mkfs_vfat_main(int argc UNUSED_PARAM, char **argv) | |||
273 | device_num == 0x0d00 || // xd | 273 | device_num == 0x0d00 || // xd |
274 | device_num == 0x1600 ) // hdc, hdd | 274 | device_num == 0x1600 ) // hdc, hdd |
275 | ) | 275 | ) |
276 | bb_error_msg_and_die("Will not try to make filesystem on full-disk device (use -I if wanted)"); | 276 | bb_error_msg_and_die("will not try to make filesystem on full-disk device (use -I if wanted)"); |
277 | // can't work on mounted filesystems | 277 | // can't work on mounted filesystems |
278 | if (find_mount_point(device_name, NULL)) | 278 | if (find_mount_point(device_name)) |
279 | bb_error_msg_and_die("Can't format mounted filesystem"); | 279 | bb_error_msg_and_die("can't format mounted filesystem"); |
280 | #endif | 280 | #endif |
281 | // get true sector size | 281 | // get true sector size |
282 | // (parameter must be int*, not long* or size_t*) | 282 | // (parameter must be int*, not long* or size_t*) |