Skip to content

Commit

Permalink
sway: restore SIGPIPE handler before exec:ing swaybar
Browse files Browse the repository at this point in the history
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/[email protected]/msg1806907.html
  • Loading branch information
dnkl authored and emersion committed Jun 5, 2021
1 parent 1dd6df6 commit 3bf9919
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions sway/config/bar.c
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ static void invoke_swaybar(struct bar_config *bar) {
sigset_t set;
sigemptyset(&set);
sigprocmask(SIG_SETMASK, &set, NULL);
signal(SIGPIPE, SIG_DFL);

pid = fork();
if (pid < 0) {
Expand Down

0 comments on commit 3bf9919

Please sign in to comment.