diff options
author | Daniel Eklöf <daniel@ekloef.se> | 2021-06-02 19:55:03 +0200 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2021-06-05 11:50:11 +0200 |
commit | 3bf99198a66e794502d338f3d4ee790f9798a01b (patch) | |
tree | 4626e592663471cb9eb8ec0b99f9774fa27a7f0f /sway/config | |
parent | sway: commands: exec: restore SIGPIPE before exec:ing (diff) | |
download | sway-3bf99198a66e794502d338f3d4ee790f9798a01b.tar.gz sway-3bf99198a66e794502d338f3d4ee790f9798a01b.tar.zst sway-3bf99198a66e794502d338f3d4ee790f9798a01b.zip |
sway: restore SIGPIPE handler before exec:ing swaybar
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/config')
-rw-r--r-- | sway/config/bar.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/sway/config/bar.c b/sway/config/bar.c index 8970f3fd..e09add44 100644 --- a/sway/config/bar.c +++ b/sway/config/bar.c | |||
@@ -217,6 +217,7 @@ static void invoke_swaybar(struct bar_config *bar) { | |||
217 | sigset_t set; | 217 | sigset_t set; |
218 | sigemptyset(&set); | 218 | sigemptyset(&set); |
219 | sigprocmask(SIG_SETMASK, &set, NULL); | 219 | sigprocmask(SIG_SETMASK, &set, NULL); |
220 | signal(SIGPIPE, SIG_DFL); | ||
220 | 221 | ||
221 | pid = fork(); | 222 | pid = fork(); |
222 | if (pid < 0) { | 223 | if (pid < 0) { |