]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
sh: Keep ignored SIGINT/SIGQUIT after set in a background job
authorJilles Tjoelker <jilles@FreeBSD.org>
Fri, 28 Aug 2020 15:35:45 +0000 (15:35 +0000)
committerJilles Tjoelker <jilles@FreeBSD.org>
Fri, 28 Aug 2020 15:35:45 +0000 (15:35 +0000)
commit1cffe8b812e5efda80d7c68dab86d2e1906ef088
treeca257340e5cbd1bd5dc5b4ba0113f21f6194e3ef
parent27b293b0229d620a19dd8ebe18dc870b597640b6
sh: Keep ignored SIGINT/SIGQUIT after set in a background job

If job control is not enabled, a background job (... &) ignores SIGINT and
SIGQUIT, but this can be reverted using the trap builtin in the same shell
environment.

Using the set builtin to change options would also revert SIGINT and SIGQUIT
to their previous dispositions.

This broke due to r317298. Calling setsignal() reverts the effect of
ignoresig().

Reported by: bdrewery
MFC after: 1 week
bin/sh/main.c
bin/sh/tests/execution/Makefile
bin/sh/tests/execution/bg13.0 [new file with mode: 0644]
bin/sh/trap.c
bin/sh/trap.h