fix failures found by randomconfig builds
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
diff --git a/libbb/Kbuild.src b/libbb/Kbuild.src
index c5d86c0..a6468f1 100644
--- a/libbb/Kbuild.src
+++ b/libbb/Kbuild.src
@@ -144,7 +144,7 @@
lib-$(CONFIG_PASSWD) += pw_encrypt.o update_passwd.o obscure.o
lib-$(CONFIG_CHPASSWD) += pw_encrypt.o update_passwd.o
lib-$(CONFIG_CRYPTPW) += pw_encrypt.o
-lib-$(CONFIG_SULOGIN) += pw_encrypt.o
+lib-$(CONFIG_SULOGIN) += pw_encrypt.o correct_password.o
lib-$(CONFIG_VLOCK) += pw_encrypt.o correct_password.o
lib-$(CONFIG_SU) += pw_encrypt.o correct_password.o
lib-$(CONFIG_LOGIN) += pw_encrypt.o correct_password.o
diff --git a/libbb/correct_password.c b/libbb/correct_password.c
index 5727c65..acadf39 100644
--- a/libbb/correct_password.c
+++ b/libbb/correct_password.c
@@ -30,15 +30,6 @@
#include "libbb.h"
-void FAST_FUNC nuke_str(char *str)
-{
- if (str) {
- while (*str)
- *str++ = 0;
- /* or: memset(str, 0, strlen(str)); - not as small as above */
- }
-}
-
/* Ask the user for a password.
* Return 1 without asking if PW has an empty password.
* Return -1 on EOF, error while reading input, or timeout.
diff --git a/libbb/in_ether.c b/libbb/in_ether.c
index dadadba..1de383b 100644
--- a/libbb/in_ether.c
+++ b/libbb/in_ether.c
@@ -3,6 +3,7 @@
* Utility routines.
*/
+//kbuild:lib-$(CONFIG_ARP) += in_ether.o
//kbuild:lib-$(CONFIG_IFCONFIG) += in_ether.o
//kbuild:lib-$(CONFIG_IFENSLAVE) += in_ether.o
diff --git a/libbb/nuke_str.c b/libbb/nuke_str.c
new file mode 100644
index 0000000..56b808b
--- /dev/null
+++ b/libbb/nuke_str.c
@@ -0,0 +1,21 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * Utility routines.
+ *
+ * Copyright (C) 2008 Denys Vlasenko
+ *
+ * Licensed under GPLv2, see file LICENSE in this source tree.
+ */
+
+//kbuild:lib-y += nuke_str.o
+
+#include "libbb.h"
+
+void FAST_FUNC nuke_str(char *str)
+{
+ if (str) {
+ while (*str)
+ *str++ = 0;
+ /* or: memset(str, 0, strlen(str)); - not as small as above */
+ }
+}
diff --git a/scripts/randomtest b/scripts/randomtest
index a102593..d2b26bc 100755
--- a/scripts/randomtest
+++ b/scripts/randomtest
@@ -65,6 +65,7 @@
| grep -v CONFIG_BUILD_LIBBUSYBOX \
| grep -v CONFIG_PIE \
\
+ | grep -v CONFIG_FEATURE_TOUCH_NODEREF \
| grep -v CONFIG_FEATURE_2_4_MODULES \
>.config.new
mv .config.new .config
@@ -72,6 +73,7 @@
echo '# CONFIG_BUILD_LIBBUSYBOX is not set' >>.config
echo '# CONFIG_PIE is not set' >>.config
echo '# CONFIG_FEATURE_2_4_MODULES is not set' >>.config
+ echo '# CONFIG_FEATURE_TOUCH_NODEREF is not set' >>.config
fi
# If STATIC, remove some things.
diff --git a/testsuite/awk.tests b/testsuite/awk.tests
index 50b2a83..132afc6 100755
--- a/testsuite/awk.tests
+++ b/testsuite/awk.tests
@@ -269,10 +269,12 @@
"" \
"a:b c:d\ne:f g:h"
+optional FEATURE_AWK_LIBM
testing "awk large integer" \
"awk 'BEGIN{n=(2^31)-1; print n, int(n), n%1, ++n, int(n), n%1}'" \
"2147483647 2147483647 0 2147483648 2147483648 0\n" \
"" ""
+SKIP=
testing "awk length(array)" \
"awk 'BEGIN{ A[1]=2; A[\"qwe\"]=\"asd\"; print length(A)}'" \
@@ -285,11 +287,13 @@
"do re mi\n" \
'{print $2; print ARGC;}' \
+optional FEATURE_AWK_GNU_EXTENSIONS
testing "awk -e and ARGC" \
"awk -e '{print \$2; print ARGC;}' input" \
"re\n2\n" \
"do re mi\n" \
- "" \
+ ""
+SKIP=
# testing "description" "command" "result" "infile" "stdin"
diff --git a/testsuite/tar.tests b/testsuite/tar.tests
index 93ba5f0..9ea89f1 100755
--- a/testsuite/tar.tests
+++ b/testsuite/tar.tests
@@ -25,10 +25,12 @@
SKIP=
optional FEATURE_SEAMLESS_GZ
+# In NOMMU case, "invalid magic" message comes from gunzip child process.
+# Otherwise, it comes from tar.
+# Need to fix output up to avoid false positive.
testing "Empty file is not a tarball.tar.gz" '\
-tar xvzf - 2>&1; echo $?
+{ tar xvzf - 2>&1; echo $?; } | grep -Fv "invalid magic"
' "\
-tar: invalid magic
tar: short read
1
" \