hush: output bash-compat killing signal names

This significantly syncronises ash-signals and hush-signals tests.

function                                             old     new   delta
process_wait_result                                  449     450      +1

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko
2020-10-24 04:26:43 +02:00
parent b65d6cb00f
commit e16f7eb596
9 changed files with 92 additions and 7 deletions

View File

@@ -2,4 +2,4 @@ sending USR2
caught
sending USR2
sending USR2
USR2
User defined signal 2

View File

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

View File

@@ -0,0 +1,28 @@
trap "echo got signal" USR1
for try in 1 2 3 4 5; do
kill -USR1 $$
sleep 0.2
echo "sent $try signal"
done &
# Ensure "wait" has something to wait for
sleep 2 &
# Ensure we do not execute "trap" below before "kill -USR1" above
# (was getting failure on loaded machine without this)
sleep 0.1
sleeping=true
while $sleeping; do
trap
if wait %%; then
echo "sleep completed"
sleeping=false
elif [ $? = 127 ]; then
echo "BUG: no processes to wait for?!"
sleeping=false
else
echo "wait interrupted"
fi
done

View File

@@ -1,2 +1,2 @@
HUP
Hangup
Done:129

View File

@@ -17,5 +17,5 @@ Ok
trap -- '' HUP
trap -- '' QUIT
trap -- '' SYS
TERM
Terminated
Done