1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2024-06-01 12:56:04 +02:00

22277: missed bit

This commit is contained in:
Peter Stephenson 2006-03-03 22:09:58 +00:00
parent 31f6b3fb07
commit 862c974d7c

View File

@ -253,6 +253,40 @@
>Exiting, attempt 2
>Running exit trap
print Another test that takes three seconds >&8
gotsig=0
signal_handler() {
echo "parent received signal"
gotsig=1
}
child() {
sleep 1
echo "child sending signal"
kill -15 $parentpid
sleep 2
echo "child exiting"
exit 33
}
parentpid=$$
child &
childpid=$!
trap signal_handler 15
echo "parent waiting"
wait $childpid
cstatus=$?
echo "wait #1 finished, gotsig=$gotsig, status=$cstatus"
gotsig=0
wait $childpid
cstatus=$?
echo "wait #2 finished, gotsig=$gotsig, status=$cstatus"
0:waiting for trapped signal
>parent waiting
>child sending signal
>parent received signal
>wait #1 finished, gotsig=1, status=143
>child exiting
>wait #2 finished, gotsig=0, status=33
%clean
rm -f TRAPEXIT