diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2010-11-22 23:49:10 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2010-11-22 23:49:10 +0100 |
commit | 26777aa1c659b229f07205291241e45e64712a72 (patch) | |
tree | 9f145eef2fe8ffb957ab89ee2f6d0ea9dc7dbd2e | |
parent | 29ca1591335b2a73522c2c3ef43daff63c71e8dc (diff) | |
download | busybox-w32-26777aa1c659b229f07205291241e45e64712a72.tar.gz busybox-w32-26777aa1c659b229f07205291241e45e64712a72.tar.bz2 busybox-w32-26777aa1c659b229f07205291241e45e64712a72.zip |
fixes for bugs discovered by randomconfig builds and tests
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | libbb/Kbuild.src | 1 | ||||
-rwxr-xr-x | scripts/randomtest.loop | 2 | ||||
-rw-r--r-- | shell/ash.c | 9 | ||||
-rw-r--r-- | shell/hush.c | 6 | ||||
-rw-r--r-- | testsuite/du/du-h-works | 2 | ||||
-rwxr-xr-x | testsuite/md5sum.tests | 5 | ||||
-rw-r--r-- | util-linux/acpid.c | 11 |
7 files changed, 26 insertions, 10 deletions
diff --git a/libbb/Kbuild.src b/libbb/Kbuild.src index 806cace28..0fa145159 100644 --- a/libbb/Kbuild.src +++ b/libbb/Kbuild.src | |||
@@ -158,6 +158,7 @@ lib-$(CONFIG_RTCWAKE) += rtc.o | |||
158 | 158 | ||
159 | lib-$(CONFIG_IOSTAT) += get_cpu_count.o | 159 | lib-$(CONFIG_IOSTAT) += get_cpu_count.o |
160 | lib-$(CONFIG_MPSTAT) += get_cpu_count.o | 160 | lib-$(CONFIG_MPSTAT) += get_cpu_count.o |
161 | lib-$(CONFIG_POWERTOP) += get_cpu_count.o | ||
161 | 162 | ||
162 | # We shouldn't build xregcomp.c if we don't need it - this ensures we don't | 163 | # We shouldn't build xregcomp.c if we don't need it - this ensures we don't |
163 | # require regex.h to be in the include dir even if we don't need it thereby | 164 | # require regex.h to be in the include dir even if we don't need it thereby |
diff --git a/scripts/randomtest.loop b/scripts/randomtest.loop index 311536df8..2c8a9bd35 100755 --- a/scripts/randomtest.loop +++ b/scripts/randomtest.loop | |||
@@ -4,7 +4,7 @@ test -d "$1" || { echo "'$1' is not a directory"; exit 1; } | |||
4 | test -x "$1/scripts/randomtest" || { echo "No scripts/randomtest in '$1'"; exit 1; } | 4 | test -x "$1/scripts/randomtest" || { echo "No scripts/randomtest in '$1'"; exit 1; } |
5 | 5 | ||
6 | export LIBC="uclibc" | 6 | export LIBC="uclibc" |
7 | export CROSS_COMPILER_PREFIX="i486-linux-uclibc-" | 7 | export CROSS_COMPILER_PREFIX="i686-" |
8 | export MAKEOPTS="-j9" | 8 | export MAKEOPTS="-j9" |
9 | 9 | ||
10 | cnt=0 | 10 | cnt=0 |
diff --git a/shell/ash.c b/shell/ash.c index 5ef7efbdb..5671a524b 100644 --- a/shell/ash.c +++ b/shell/ash.c | |||
@@ -43,7 +43,9 @@ | |||
43 | #include <sys/times.h> | 43 | #include <sys/times.h> |
44 | 44 | ||
45 | #include "shell_common.h" | 45 | #include "shell_common.h" |
46 | #include "math.h" | 46 | #if ENABLE_SH_MATH_SUPPORT |
47 | # include "math.h" | ||
48 | #endif | ||
47 | #if ENABLE_ASH_RANDOM_SUPPORT | 49 | #if ENABLE_ASH_RANDOM_SUPPORT |
48 | # include "random.h" | 50 | # include "random.h" |
49 | #else | 51 | #else |
@@ -5510,6 +5512,11 @@ static struct arglist exparg; | |||
5510 | /* | 5512 | /* |
5511 | * Our own itoa(). | 5513 | * Our own itoa(). |
5512 | */ | 5514 | */ |
5515 | #if !ENABLE_SH_MATH_SUPPORT | ||
5516 | /* cvtnum() is used even if math support is off (to prepare $? values and such) */ | ||
5517 | typedef long arith_t; | ||
5518 | # define ARITH_FMT "%ld" | ||
5519 | #endif | ||
5513 | static int | 5520 | static int |
5514 | cvtnum(arith_t num) | 5521 | cvtnum(arith_t num) |
5515 | { | 5522 | { |
diff --git a/shell/hush.c b/shell/hush.c index da32c2435..26a50744e 100644 --- a/shell/hush.c +++ b/shell/hush.c | |||
@@ -712,11 +712,11 @@ struct globals { | |||
712 | int last_jobid; | 712 | int last_jobid; |
713 | pid_t saved_tty_pgrp; | 713 | pid_t saved_tty_pgrp; |
714 | struct pipe *job_list; | 714 | struct pipe *job_list; |
715 | char o_opt[NUM_OPT_O]; | ||
716 | # define G_saved_tty_pgrp (G.saved_tty_pgrp) | 715 | # define G_saved_tty_pgrp (G.saved_tty_pgrp) |
717 | #else | 716 | #else |
718 | # define G_saved_tty_pgrp 0 | 717 | # define G_saved_tty_pgrp 0 |
719 | #endif | 718 | #endif |
719 | char o_opt[NUM_OPT_O]; | ||
720 | smallint flag_SIGINT; | 720 | smallint flag_SIGINT; |
721 | #if ENABLE_HUSH_LOOPS | 721 | #if ENABLE_HUSH_LOOPS |
722 | smallint flag_break_continue; | 722 | smallint flag_break_continue; |
@@ -4500,7 +4500,9 @@ static struct pipe *parse_stream(char **pstring, | |||
4500 | expand_string_to_string(str) | 4500 | expand_string_to_string(str) |
4501 | #endif | 4501 | #endif |
4502 | static char *expand_string_to_string(const char *str, int do_unbackslash); | 4502 | static char *expand_string_to_string(const char *str, int do_unbackslash); |
4503 | #if ENABLE_HUSH_TICK | ||
4503 | static int process_command_subs(o_string *dest, const char *s); | 4504 | static int process_command_subs(o_string *dest, const char *s); |
4505 | #endif | ||
4504 | 4506 | ||
4505 | /* expand_strvec_to_strvec() takes a list of strings, expands | 4507 | /* expand_strvec_to_strvec() takes a list of strings, expands |
4506 | * all variable references within and returns a pointer to | 4508 | * all variable references within and returns a pointer to |
@@ -6579,7 +6581,7 @@ static int checkjobs_and_fg_shell(struct pipe *fg_pipe) | |||
6579 | * subshell: ( list ) [&] | 6581 | * subshell: ( list ) [&] |
6580 | */ | 6582 | */ |
6581 | #if !ENABLE_HUSH_MODE_X | 6583 | #if !ENABLE_HUSH_MODE_X |
6582 | #define redirect_and_varexp_helper(new_env_p, old_vars_p, command, squirrel, char argv_expanded) \ | 6584 | #define redirect_and_varexp_helper(new_env_p, old_vars_p, command, squirrel, argv_expanded) \ |
6583 | redirect_and_varexp_helper(new_env_p, old_vars_p, command, squirrel) | 6585 | redirect_and_varexp_helper(new_env_p, old_vars_p, command, squirrel) |
6584 | #endif | 6586 | #endif |
6585 | static int redirect_and_varexp_helper(char ***new_env_p, | 6587 | static int redirect_and_varexp_helper(char ***new_env_p, |
diff --git a/testsuite/du/du-h-works b/testsuite/du/du-h-works index c18433c29..1c77b6552 100644 --- a/testsuite/du/du-h-works +++ b/testsuite/du/du-h-works | |||
@@ -1,4 +1,4 @@ | |||
1 | # FEATURE: CONFIG_FEATURE_HUMAN_READABLE | 1 | # FEATURE: CONFIG_FEATURE_HUMAN_READABLE |
2 | 2 | ||
3 | dd if=/dev/zero of=file bs=1M count=1 2>/dev/null | 3 | dd if=/dev/zero of=file bs=1M count=1 2>/dev/null |
4 | test x"`busybox du -h .`" = x"1.0M ." | 4 | test x"`busybox du -h file`" = x"1.0M file" |
diff --git a/testsuite/md5sum.tests b/testsuite/md5sum.tests index 35ec67cb4..1068b083f 100755 --- a/testsuite/md5sum.tests +++ b/testsuite/md5sum.tests | |||
@@ -18,6 +18,11 @@ fi | |||
18 | sum="$1" | 18 | sum="$1" |
19 | expected="$2" | 19 | expected="$2" |
20 | 20 | ||
21 | test -f "$bindir/.config" && . "$bindir/.config" | ||
22 | |||
23 | test x"$CONFIG_FEATURE_FANCY_HEAD" != x"y" \ | ||
24 | && { echo "SKIPPED: $sum"; exit 0; } | ||
25 | |||
21 | text="The quick brown fox jumps over the lazy dog" | 26 | text="The quick brown fox jumps over the lazy dog" |
22 | text=`yes "$text" | head -c 9999` | 27 | text=`yes "$text" | head -c 9999` |
23 | 28 | ||
diff --git a/util-linux/acpid.c b/util-linux/acpid.c index 0b227a8ae..ce4c98ebe 100644 --- a/util-linux/acpid.c +++ b/util-linux/acpid.c | |||
@@ -16,9 +16,9 @@ enum { | |||
16 | OPT_e = (1 << 2), | 16 | OPT_e = (1 << 2), |
17 | OPT_f = (1 << 3), | 17 | OPT_f = (1 << 3), |
18 | OPT_l = (1 << 4), | 18 | OPT_l = (1 << 4), |
19 | OPT_p = (1 << 5) * ENABLE_FEATURE_PIDFILE, | 19 | OPT_a = (1 << 5), |
20 | OPT_a = (1 << 6), | 20 | OPT_M = (1 << 6), |
21 | OPT_M = (1 << 7), | 21 | OPT_p = (1 << 7) * ENABLE_FEATURE_PIDFILE, |
22 | }; | 22 | }; |
23 | 23 | ||
24 | struct acpi_event { | 24 | struct acpi_event { |
@@ -199,8 +199,9 @@ int acpid_main(int argc UNUSED_PARAM, char **argv) | |||
199 | INIT_G(); | 199 | INIT_G(); |
200 | 200 | ||
201 | opt_complementary = "df:e--e"; | 201 | opt_complementary = "df:e--e"; |
202 | opts = getopt32(argv, "c:de:fl:p:a:M:" IF_FEATURE_ACPID_COMPAT("g:m:s:S:v"), | 202 | opts = getopt32(argv, "c:de:fl:a:M:" IF_FEATURE_PIDFILE("p:") IF_FEATURE_ACPID_COMPAT("g:m:s:S:v"), |
203 | &opt_dir, &opt_input, &opt_logfile, &opt_pidfile, &opt_action, &opt_map | 203 | &opt_dir, &opt_input, &opt_logfile, &opt_action, &opt_map |
204 | IF_FEATURE_PIDFILE(, &opt_pidfile) | ||
204 | IF_FEATURE_ACPID_COMPAT(, NULL, NULL, NULL, NULL) | 205 | IF_FEATURE_ACPID_COMPAT(, NULL, NULL, NULL, NULL) |
205 | ); | 206 | ); |
206 | 207 | ||