summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQuentin Carbonneaux2014-12-26 09:26:13 -0500
committerQuentin Carbonneaux2014-12-26 09:26:13 -0500
commitad7d23c907ab60797d9c2cffe3f30f76624c1de8 (patch)
treedcf5c658672f6e826baa2ef2c9aa072173a5810b
parentb1634e68630d9d46af933225858969d6d3e42e48 (diff)
ignore SIGPIPE
Otherwise, the editor crashes when using the redirection sigils with a command that closes the pipe.
-rw-r--r--main.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/main.c b/main.c
index e9de2a7..105ea91 100644
--- a/main.c
+++ b/main.c
@@ -1,6 +1,7 @@
#include <assert.h>
#include <ctype.h>
#include <setjmp.h>
+#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -162,6 +163,7 @@ main(int ac, char *av[])
{
int guifd;
+ signal(SIGPIPE, SIG_IGN);
g = &gui_x11;
guifd = g->init();
ev_register(guifd, ERead, gev, 0);