mirror of
https://github.com/sheumann/hush.git
synced 2024-12-21 08:29:45 +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
|
||||
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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user