summaryrefslogtreecommitdiffstats
path: root/proc.c
diff options
context:
space:
mode:
authornicm <nicm>2017-07-14 18:49:07 +0000
committernicm <nicm>2017-07-14 18:49:07 +0000
commit932f6cfbfc98ab2d6e593f7fa3473a6bb3269967 (patch)
tree458fd646c28b3655f2ca1ca6a228188cc49ca2e0 /proc.c
parent2678fe53f57c4a3222780c76a7201f4300058e59 (diff)
Because ignore SIGCHLD early, letting signal_del restore it doesn't work
correctly, so set it explicitly back to default (and the others for good measure).
Diffstat (limited to 'proc.c')
-rw-r--r--proc.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/proc.c b/proc.c
index 68738229..48e0d90c 100644
--- a/proc.c
+++ b/proc.c
@@ -242,7 +242,7 @@ proc_set_signals(struct tmuxproc *tp, void (*signalcb)(int))
}
void
-proc_clear_signals(struct tmuxproc *tp)
+proc_clear_signals(struct tmuxproc *tp, int defaults)
{
struct sigaction sa;
@@ -262,6 +262,16 @@ proc_clear_signals(struct tmuxproc *tp)
signal_del(&tp->ev_sigusr1);
signal_del(&tp->ev_sigusr2);
signal_del(&tp->ev_sigwinch);
+
+ if (defaults) {
+ sigaction(SIGHUP, &sa, NULL);
+ sigaction(SIGCHLD, &sa, NULL);
+ sigaction(SIGCONT, &sa, NULL);
+ sigaction(SIGTERM, &sa, NULL);
+ sigaction(SIGUSR1, &sa, NULL);
+ sigaction(SIGUSR2, &sa, NULL);
+ sigaction(SIGWINCH, &sa, NULL);
+ }
}
struct tmuxpeer *