xref: /freebsd/bin/sh/tests/execution/bg13.0 (revision a4e5e0106ac7145f56eb39a691e302cabb4635be)
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{ set -C; trap 'exit 5' TERM; read dummy <fifo1; exit 4; } &
9exec 3>fifo1
10kill -INT "$!"
11kill -TERM "$!"
12exec 3>&-
13wait "$!"
14r=$?
15[ "$r" = 5 ]
16