diff options
author | Daniel Eklöf <daniel@ekloef.se> | 2021-06-02 19:52:10 +0200 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2021-06-05 11:50:11 +0200 |
commit | 1dd6df6a5df3924d42a25bd17dab0ef8beecad61 (patch) | |
tree | 085430957c6112e52bfda6ee07109757898308b8 /sway/commands/exec_always.c | |
parent | config: Fix swaybar pango_markup inconsistency (diff) | |
download | sway-1dd6df6a5df3924d42a25bd17dab0ef8beecad61.tar.gz sway-1dd6df6a5df3924d42a25bd17dab0ef8beecad61.tar.zst sway-1dd6df6a5df3924d42a25bd17dab0ef8beecad61.zip |
sway: commands: exec: restore SIGPIPE before exec:ing
Sway ignores SIGPIPE (by installing a SIG_IGN handler), in order to
“prevent IPC from crashing Sway”.
SIG_IGN handlers are the *only* signal handlers inherited in
sub-processes. As such, we should be a good citizen and restore
the SIGPIPE handler to its default handler.
Original bug report:
https://www.mail-archive.com/debian-bugs-dist@lists.debian.org/msg1806907.html
Diffstat (limited to 'sway/commands/exec_always.c')
-rw-r--r-- | sway/commands/exec_always.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/sway/commands/exec_always.c b/sway/commands/exec_always.c index e18e2c22..fce337d5 100644 --- a/sway/commands/exec_always.c +++ b/sway/commands/exec_always.c | |||
@@ -57,6 +57,7 @@ struct cmd_results *cmd_exec_process(int argc, char **argv) { | |||
57 | sigset_t set; | 57 | sigset_t set; |
58 | sigemptyset(&set); | 58 | sigemptyset(&set); |
59 | sigprocmask(SIG_SETMASK, &set, NULL); | 59 | sigprocmask(SIG_SETMASK, &set, NULL); |
60 | signal(SIGPIPE, SIG_DFL); | ||
60 | close(fd[0]); | 61 | close(fd[0]); |
61 | if ((child = fork()) == 0) { | 62 | if ((child = fork()) == 0) { |
62 | close(fd[1]); | 63 | close(fd[1]); |