From: Petr Písař Date: Thu, 24 Apr 2014 18:35:17 +0000 (+0200) Subject: Reset SIGIPE handler before executing a command X-Git-Tag: 4.8~74 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=2cc51841a5919a34ff26d5d61c2264d9cb2b43a0;p=i3%2Fi3 Reset SIGIPE handler before executing a command This commit: commit fb6d117c42ce3d9988ff44c079814b3840b1e37f Author: Axel Wagner Date: Thu Dec 30 21:09:32 2010 +0100 Port sighandler to tree-branch blocks SIGPIPE. Unfortunatelly blocked signal set is preserved accross execve()s, so any program executed by i3 inherited blocked SIGPIPE signal. This leads to courious effects when pipe writer does not terminate after exiting pipe reader. Simple reproducer is to spawn a new xterm by a key shortcut and then run this command there: $ perl -e 'print $SIG{PIPE}, qq{\n}' IGNORE fixes #1237 --- diff --git a/src/startup.c b/src/startup.c index 85e5dbc2..a3e4d58e 100644 --- a/src/startup.c +++ b/src/startup.c @@ -187,6 +187,7 @@ void start_application(const char *command, bool no_startup_id) { } unsetenv("LISTEN_PID"); unsetenv("LISTEN_FDS"); + signal(SIGPIPE, SIG_DFL); if (fork() == 0) { /* Setup the environment variable(s) */ if (!no_startup_id)