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