ash: fix testcase to not sleep for whole 10 seconds,

gets annoying pretty fast. Also fix wrong message there.
This commit is contained in:
Denis Vlasenko 2008-07-26 13:53:42 +00:00
parent 87d5fd984e
commit 5c13270359
2 changed files with 11 additions and 12 deletions

View File

@ -2,19 +2,19 @@ got signal
trap -- 'echo got signal' USR1
sent 1 signal
got signal
sleep interrupted
wait interrupted
trap -- 'echo got signal' USR1
sent 2 signal
got signal
sleep interrupted
wait interrupted
trap -- 'echo got signal' USR1
sent 3 signal
got signal
sleep interrupted
wait interrupted
trap -- 'echo got signal' USR1
sent 4 signal
got signal
sleep interrupted
wait interrupted
trap -- 'echo got signal' USR1
sent 5 signal
sleep completed

View File

@ -1,24 +1,23 @@
sleeping=true
trap "echo got signal" USR1
for try in 1 2 3 4 5; do
kill -USR1 $$
sleep 1
echo sent $try signal
sleep 0.2
echo "sent $try signal"
done &
sleep 10 &
sleep 2 &
sleeping=true
while $sleeping; do
trap
if wait %%; then
echo sleep completed
echo "sleep completed"
sleeping=false
elif [ $? == 127 ]; then
echo no sleep tonite
echo "BUG: no processes to wait for?!"
sleeping=false
else
echo sleep interrupted;
echo "wait interrupted"
fi
done