xref: /freebsd/bin/sh/tests/execution/bg11.0 (revision e67e85659c0de33e617e5fbf1028c6e8b49eee53)
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{ trap 'exit 5' TERM; read dummy <fifo1; exit 4; } &
10exec 3>fifo1
11kill -INT "$!"
12kill -TERM "$!"
13exec 3>&-
14wait "$!"
15r=$?
16[ "$r" = 5 ]
17