xref: /freebsd/bin/sh/tests/execution/bg13.0 (revision 22cf89c938886d14f5796fc49f9f020c23ea8eaf)
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