fixes for bugs discovered by randomconfig builds and tests
authorDenys Vlasenko <vda.linux@googlemail.com>
Mon, 22 Nov 2010 22:49:10 +0000 (23:49 +0100)
committerDenys Vlasenko <vda.linux@googlemail.com>
Mon, 22 Nov 2010 22:49:10 +0000 (23:49 +0100)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
libbb/Kbuild.src
scripts/randomtest.loop
shell/ash.c
shell/hush.c
testsuite/du/du-h-works
testsuite/md5sum.tests
util-linux/acpid.c

index 806cace286fe68bfe5bd7326979fecd00b94ed11..0fa14515975e0c2f467cd2a7e1ab4b4dff1f5633 100644 (file)
@@ -158,6 +158,7 @@ lib-$(CONFIG_RTCWAKE) += rtc.o
 
 lib-$(CONFIG_IOSTAT) += get_cpu_count.o
 lib-$(CONFIG_MPSTAT) += get_cpu_count.o
+lib-$(CONFIG_POWERTOP) += get_cpu_count.o
 
 # We shouldn't build xregcomp.c if we don't need it - this ensures we don't
 # require regex.h to be in the include dir even if we don't need it thereby
index 311536df85464dee4aa24d10cefc7e3dce186db0..2c8a9bd35ba6688fe000006dbe07cbd8c1e77634 100755 (executable)
@@ -4,7 +4,7 @@ test -d "$1" || { echo "'$1' is not a directory"; exit 1; }
 test -x "$1/scripts/randomtest" || { echo "No scripts/randomtest in '$1'"; exit 1; }
 
 export LIBC="uclibc"
-export CROSS_COMPILER_PREFIX="i486-linux-uclibc-"
+export CROSS_COMPILER_PREFIX="i686-"
 export MAKEOPTS="-j9"
 
 cnt=0
index 5ef7efbdbf9d2ab88666698852fdfd83cd16d189..5671a524b44795fff63669c4a69dcf5b99b94081 100644 (file)
@@ -43,7 +43,9 @@
 #include <sys/times.h>
 
 #include "shell_common.h"
-#include "math.h"
+#if ENABLE_SH_MATH_SUPPORT
+# include "math.h"
+#endif
 #if ENABLE_ASH_RANDOM_SUPPORT
 # include "random.h"
 #else
@@ -5510,6 +5512,11 @@ static struct arglist exparg;
 /*
  * Our own itoa().
  */
+#if !ENABLE_SH_MATH_SUPPORT
+/* cvtnum() is used even if math support is off (to prepare $? values and such) */
+typedef long arith_t;
+# define ARITH_FMT "%ld"
+#endif
 static int
 cvtnum(arith_t num)
 {
index da32c2435f745413b2274bcd34dec2d148d88b28..26a50744e6a29e75966d3e46ff1bab36e116ebf7 100644 (file)
@@ -712,11 +712,11 @@ struct globals {
        int last_jobid;
        pid_t saved_tty_pgrp;
        struct pipe *job_list;
-       char o_opt[NUM_OPT_O];
 # define G_saved_tty_pgrp (G.saved_tty_pgrp)
 #else
 # define G_saved_tty_pgrp 0
 #endif
+       char o_opt[NUM_OPT_O];
        smallint flag_SIGINT;
 #if ENABLE_HUSH_LOOPS
        smallint flag_break_continue;
@@ -4500,7 +4500,9 @@ static struct pipe *parse_stream(char **pstring,
        expand_string_to_string(str)
 #endif
 static char *expand_string_to_string(const char *str, int do_unbackslash);
+#if ENABLE_HUSH_TICK
 static int process_command_subs(o_string *dest, const char *s);
+#endif
 
 /* expand_strvec_to_strvec() takes a list of strings, expands
  * all variable references within and returns a pointer to
@@ -6579,7 +6581,7 @@ static int checkjobs_and_fg_shell(struct pipe *fg_pipe)
  * subshell:     ( list ) [&]
  */
 #if !ENABLE_HUSH_MODE_X
-#define redirect_and_varexp_helper(new_env_p, old_vars_p, command, squirrel, char argv_expanded) \
+#define redirect_and_varexp_helper(new_env_p, old_vars_p, command, squirrel, argv_expanded) \
        redirect_and_varexp_helper(new_env_p, old_vars_p, command, squirrel)
 #endif
 static int redirect_and_varexp_helper(char ***new_env_p,
index c18433c29669198a31251b59f636b5aa5be8edb4..1c77b655284cf5e551b3261ac1d0a2c55c5fee87 100644 (file)
@@ -1,4 +1,4 @@
 # FEATURE: CONFIG_FEATURE_HUMAN_READABLE
 
 dd if=/dev/zero of=file bs=1M count=1 2>/dev/null
-test x"`busybox du -h .`" = x"1.0M     ."
+test x"`busybox du -h file`" = x"1.0M  file"
index 35ec67cb4f11e4040eacf99e8e3be31d592ed6a3..1068b083f588e8a97e5edd4fec7e23c0f66f6f14 100755 (executable)
@@ -18,6 +18,11 @@ fi
 sum="$1"
 expected="$2"
 
+test -f "$bindir/.config" && . "$bindir/.config"
+
+test x"$CONFIG_FEATURE_FANCY_HEAD" != x"y" \
+&& { echo "SKIPPED: $sum"; exit 0; }
+
 text="The quick brown fox jumps over the lazy dog"
 text=`yes "$text" | head -c 9999`
 
index 0b227a8aef5ad3867368b5d1f58b11f06b5876ce..ce4c98ebe8754ffe600a94c8405350fb13ca8964 100644 (file)
@@ -16,9 +16,9 @@ enum {
        OPT_e = (1 << 2),
        OPT_f = (1 << 3),
        OPT_l = (1 << 4),
-       OPT_p = (1 << 5) * ENABLE_FEATURE_PIDFILE,
-       OPT_a = (1 << 6),
-       OPT_M = (1 << 7),
+       OPT_a = (1 << 5),
+       OPT_M = (1 << 6),
+       OPT_p = (1 << 7) * ENABLE_FEATURE_PIDFILE,
 };
 
 struct acpi_event {
@@ -199,8 +199,9 @@ int acpid_main(int argc UNUSED_PARAM, char **argv)
        INIT_G();
 
        opt_complementary = "df:e--e";
-       opts = getopt32(argv, "c:de:fl:p:a:M:" IF_FEATURE_ACPID_COMPAT("g:m:s:S:v"),
-               &opt_dir, &opt_input, &opt_logfile, &opt_pidfile, &opt_action, &opt_map
+       opts = getopt32(argv, "c:de:fl:a:M:" IF_FEATURE_PIDFILE("p:") IF_FEATURE_ACPID_COMPAT("g:m:s:S:v"),
+               &opt_dir, &opt_input, &opt_logfile, &opt_action, &opt_map
+               IF_FEATURE_PIDFILE(, &opt_pidfile)
                IF_FEATURE_ACPID_COMPAT(, NULL, NULL, NULL, NULL)
        );