diff --git a/src/cmd/ksh93/tests/signal.sh b/src/cmd/ksh93/tests/signal.sh index b55ec56b6..ec95c10ae 100755 --- a/src/cmd/ksh93/tests/signal.sh +++ b/src/cmd/ksh93/tests/signal.sh @@ -49,18 +49,21 @@ done done EOF } | head > /dev/null - (( $? == 0)) || err_exit "SIGPIPE with wrong error code $?" - # The below is kind of bogus as the err_exit from a bg job is never counted. But see extra check below. - [[ $(/dev/null & spy=$! if wait $cop 2>/dev/null then kill $spy 2>/dev/null -else err_exit "pipe with --pipefail PIPE trap hangs or produced an error" +else # 'wait $cop' will have passed on the nonzero exit status from the background job into $? + e=$? + err_exit "pipe with --pipefail PIPE trap hangs or produced an error" \ + "(got status $e$( ((e>128)) && print -n /SIG && kill -l "$e"))" fi wait +exp=$'PIPED\nPIPED' +[[ $(