From 540664b91daf6d603e26693cc7723765b7f242ff Mon Sep 17 00:00:00 2001 From: Thomas Bächler Date: Wed, 30 Sep 2009 17:59:23 +0200 Subject: rootdelay check: Fix compatibility with other sh implementations than dash and make it more reliable The old implementation failed on bash and failed on both if rootdelay was not a number. The logic is now as follows: If "$rootdelay"="", then [ -z "${rootdelay}" ] is true If not, then the part after the || is executed - if ${rootdelay} is not a number, or is <0, then [ ${rootdelay} -ge 0 ] fails, and the test will return true due to the !. The previous implementation failed here, because [ ! ${rootdelay} -ge 0 ] returns false on error, while ! [ ${rootdelay} -ge 0 ] returns true on error. --- init | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init b/init index c44904c..0ea8750 100644 --- a/init +++ b/init @@ -64,7 +64,7 @@ for m in ${MODULES}; do done # If rootdelay is empty or not a non-negative integer, set it to 10 -if [ -z "${rootdelay}" -o ! "${rootdelay}" -ge 0 ]; then +if [ -z "${rootdelay}" ] || ! [ "${rootdelay}" -ge 0 ]; then export rootdelay=10 fi # We'll wait for the root device, so make sure klibc doesn't -- cgit v1.2.3-24-g4f1b