summaryrefslogtreecommitdiff
path: root/tests/kernel
diff options
context:
space:
mode:
authorgson <gson@NetBSD.org>2013-05-31 14:40:48 +0000
committergson <gson@NetBSD.org>2013-05-31 14:40:48 +0000
commita4f705a1c8ce5fdbbb36c8ebb7493b6170d8e448 (patch)
tree60956eecb06218858a642921294990425ad96e34 /tests/kernel
parentc6969990da0163c6af4ad1d1bf86bad9ba9ef81e (diff)
Don't rely on "kill -0" to check whether a background shell command
has exited; it does not work reliably because the process may still exist as a zombie. OK mlelstv.
Diffstat (limited to 'tests/kernel')
-rw-r--r--tests/kernel/t_umountstress.sh18
1 files changed, 9 insertions, 9 deletions
diff --git a/tests/kernel/t_umountstress.sh b/tests/kernel/t_umountstress.sh
index e5824e07b9a..fd50a1daca3 100644
--- a/tests/kernel/t_umountstress.sh
+++ b/tests/kernel/t_umountstress.sh
@@ -1,4 +1,4 @@
-# $NetBSD: t_umountstress.sh,v 1.4 2013/04/28 15:49:58 mlelstv Exp $
+# $NetBSD: t_umountstress.sh,v 1.5 2013/05/31 14:40:48 gson Exp $
#
# Copyright (c) 2013 The NetBSD Foundation, Inc.
# All rights reserved.
@@ -69,16 +69,16 @@ EOF
for k in 0 1 2 3 4 5 6 7 8 9; do
if ! dd msgfmt=quiet if=/dev/zero \
count=1 of=${TMPMP}/test$i$j$k; then
- echo 1
+ echo 1 >result
exit
fi
done
done
- echo 0
- ) > result &
+ echo 0 >result
+ ) &
busypid=$!
- while kill 2>/dev/null -0 $busypid; do
+ while ! test -f result; do
if err=$(umount ${TMPMP} 2>&1); then
kill $busypid
exec 9<&-
@@ -150,16 +150,16 @@ EOF
for j in 0 1 2 3 4 5 6 7 8 9; do
for k in 0 1 2 3 4 5 6 7 8 9; do
if ! out=$(mount); then
- echo 1
+ echo 1 >result
exit
fi
done
done
- echo 0
- ) > result &
+ echo 0 >result
+ ) &
busypid=$!
- while kill 2>/dev/null -0 $busypid; do
+ while ! test -f result; do
if err=$(umount ${TMPMP} 2>&1); then
if ! mount -o async ${BVND}${MPART} ${TMPMP}; then
kill $busypid