From 862c974d7cbb31c6b4e75163a2b61c85a268542b Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Fri, 3 Mar 2006 22:09:58 +0000 Subject: 22277: missed bit --- Test/C03traps.ztst | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'Test/C03traps.ztst') diff --git a/Test/C03traps.ztst b/Test/C03traps.ztst index ffaa70204..82e401fd1 100644 --- a/Test/C03traps.ztst +++ b/Test/C03traps.ztst @@ -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 -- cgit 1.4.1