diff options
Diffstat (limited to 'src/main/tools/process-tools.c')
-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. |