i3 - improved tiling WM


Reset SIGIPE handler before executing a command

Patch status: merged

Patch by Petr Písař

Long description:

This commit:

commit fb6d117c42ce3d9988ff44c079814b3840b1e37f
Author: Axel Wagner <mail@merovius.de>
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

To apply this patch, use:
curl http://cr.i3wm.org/patch/510/raw.patch | git am

b/src/startup.c

31
@@ -187,6 +187,7 @@ void start_application(const char *command, bool no_startup_id) {
32
         }
33
         unsetenv("LISTEN_PID");
34
         unsetenv("LISTEN_FDS");
35
+        signal(SIGPIPE, SIG_DFL);
36
         if (fork() == 0) {
37
             /* Setup the environment variable(s) */
38
             if (!no_startup_id)