diff options
author | 2016-06-13 09:00:49 +0000 | |
---|---|---|
committer | 2016-06-13 11:20:04 +0000 | |
commit | 06212ef273696686e1e5a71baa3cb43d9154101d (patch) | |
tree | 2368818c2dbf5283a0ab5f551a17805bbe4c2942 /src | |
parent | 6388680b44893c2b3ccddd73f6c4abb693a18cd4 (diff) |
Do not try to install a default handler for SIGSTOP and SIGKILL.
Fixes #1330.
--
MOS_MIGRATED_REVID=124705354
Diffstat (limited to 'src')
-rw-r--r-- | src/main/tools/process-tools.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/main/tools/process-tools.c b/src/main/tools/process-tools.c index b99de46f7c..9dddfee5f5 100644 --- a/src/main/tools/process-tools.c +++ b/src/main/tools/process-tools.c @@ -87,7 +87,18 @@ void HandleSignal(int sig, void (*handler)(int)) { CHECK_CALL(sigaction(sig, &sa, NULL)); } -void UnHandle(int sig) { HandleSignal(sig, SIG_DFL); } +void UnHandle(int sig) { + switch (sig) { + case SIGSTOP: + case SIGKILL: + // These signals can't be handled, so they'll always have a valid default + // handler. In fact, even trying to install SIG_DFL again will result in + // EINVAL, so we'll just not do anything for these. + return; + default: + HandleSignal(sig, SIG_DFL); + } +} void ClearSignalMask() { // Use an empty signal mask for the process. |