From 1dd6df6a5df3924d42a25bd17dab0ef8beecad61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Wed, 2 Jun 2021 19:52:10 +0200 Subject: [PATCH] sway: commands: exec: restore SIGPIPE before exec:ing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- sway/commands/exec_always.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sway/commands/exec_always.c b/sway/commands/exec_always.c index e18e2c226..fce337d51 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) { sigset_t set; sigemptyset(&set); sigprocmask(SIG_SETMASK, &set, NULL); + signal(SIGPIPE, SIG_DFL); close(fd[0]); if ((child = fork()) == 0) { close(fd[1]);