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