1# $FreeBSD: head/bin/sh/tests/execution/bg11.0 362182 2020-06-14 19:41:24Z 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{ trap 'exit 5' TERM; read dummy <fifo1; exit 4; } &
10exec 3>fifo1
11kill -INT "$!"
12kill -TERM "$!"
13exec 3>&-
14wait "$!"
15r=$?
16[ "$r" = 5 ]
17