1# $FreeBSD: head/bin/sh/tests/execution/bg13.0 364919 2020-08-28 15:35:45Z jilles $
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