mirror of
https://github.com/opnsense/src.git
synced 2026-02-25 19:05:20 -05:00
If job control is not enabled, background commands shall ignore SIGINT and SIGQUIT, and it shall be possible to override that ignore in the same shell. MFC after: 1 week
16 lines
361 B
Text
16 lines
361 B
Text
# $FreeBSD$
|
|
|
|
T=`mktemp -d ${TMPDIR:-/tmp}/sh-test.XXXXXXXX`
|
|
trap 'rm -rf $T' 0
|
|
cd $T || exit 3
|
|
mkfifo fifo1
|
|
# Use a trap, not the default action, since the shell may catch SIGINT and
|
|
# therefore its processing may be delayed.
|
|
{ trap 'exit 5' TERM; read dummy <fifo1; exit 4; } &
|
|
exec 3>fifo1
|
|
kill -INT "$!"
|
|
kill -TERM "$!"
|
|
exec 3>&-
|
|
wait "$!"
|
|
r=$?
|
|
[ "$r" = 5 ]
|