xref: /freebsd/bin/sh/tests/execution/bg11.0 (revision d0b2dbfa0ecf2bbc9709efc5e20baf8e4b44bbbf)
1
2T=`mktemp -d ${TMPDIR:-/tmp}/sh-test.XXXXXXXX`
3trap 'rm -rf $T' 0
4cd $T || exit 3
5mkfifo fifo1
6# Use a trap, not the default action, since the shell may catch SIGINT and
7# therefore its processing may be delayed.
8{ trap 'exit 5' TERM; read dummy <fifo1; exit 4; } &
9exec 3>fifo1
10kill -INT "$!"
11kill -TERM "$!"
12exec 3>&-
13wait "$!"
14r=$?
15[ "$r" = 5 ]
16