mirror of
https://github.com/sheumann/hush.git
synced 2024-12-21 23:29:34 +00:00
ash: fix testcase to not sleep for whole 10 seconds,
gets annoying pretty fast. Also fix wrong message there.
This commit is contained in:
parent
87d5fd984e
commit
5c13270359
@ -2,19 +2,19 @@ got signal
|
|||||||
trap -- 'echo got signal' USR1
|
trap -- 'echo got signal' USR1
|
||||||
sent 1 signal
|
sent 1 signal
|
||||||
got signal
|
got signal
|
||||||
sleep interrupted
|
wait interrupted
|
||||||
trap -- 'echo got signal' USR1
|
trap -- 'echo got signal' USR1
|
||||||
sent 2 signal
|
sent 2 signal
|
||||||
got signal
|
got signal
|
||||||
sleep interrupted
|
wait interrupted
|
||||||
trap -- 'echo got signal' USR1
|
trap -- 'echo got signal' USR1
|
||||||
sent 3 signal
|
sent 3 signal
|
||||||
got signal
|
got signal
|
||||||
sleep interrupted
|
wait interrupted
|
||||||
trap -- 'echo got signal' USR1
|
trap -- 'echo got signal' USR1
|
||||||
sent 4 signal
|
sent 4 signal
|
||||||
got signal
|
got signal
|
||||||
sleep interrupted
|
wait interrupted
|
||||||
trap -- 'echo got signal' USR1
|
trap -- 'echo got signal' USR1
|
||||||
sent 5 signal
|
sent 5 signal
|
||||||
sleep completed
|
sleep completed
|
||||||
|
@ -1,24 +1,23 @@
|
|||||||
sleeping=true
|
|
||||||
|
|
||||||
trap "echo got signal" USR1
|
trap "echo got signal" USR1
|
||||||
|
|
||||||
for try in 1 2 3 4 5; do
|
for try in 1 2 3 4 5; do
|
||||||
kill -USR1 $$
|
kill -USR1 $$
|
||||||
sleep 1
|
sleep 0.2
|
||||||
echo sent $try signal
|
echo "sent $try signal"
|
||||||
done &
|
done &
|
||||||
|
|
||||||
sleep 10 &
|
sleep 2 &
|
||||||
|
|
||||||
|
sleeping=true
|
||||||
while $sleeping; do
|
while $sleeping; do
|
||||||
trap
|
trap
|
||||||
if wait %%; then
|
if wait %%; then
|
||||||
echo sleep completed
|
echo "sleep completed"
|
||||||
sleeping=false
|
sleeping=false
|
||||||
elif [ $? == 127 ]; then
|
elif [ $? == 127 ]; then
|
||||||
echo no sleep tonite
|
echo "BUG: no processes to wait for?!"
|
||||||
sleeping=false
|
sleeping=false
|
||||||
else
|
else
|
||||||
echo sleep interrupted;
|
echo "wait interrupted"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
Loading…
Reference in New Issue
Block a user