aboutsummaryrefslogtreecommitdiffstats
path: root/builtin.c
diff options
context:
space:
mode:
Diffstat (limited to 'builtin.c')
-rw-r--r--builtin.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/builtin.c b/builtin.c
index d7101c26..fb67af4c 100644
--- a/builtin.c
+++ b/builtin.c
@@ -2092,6 +2092,10 @@ do_system(int nargs)
cmd[tmp->stlen] = '\0';
os_restore_mode(fileno(stdin));
+#ifdef SIGPIPE
+ signal(SIGPIPE, SIG_DFL);
+#endif
+
status = system(cmd);
/*
* 3/2016. What to do with ret? It's never simple.
@@ -2123,8 +2127,12 @@ do_system(int nargs)
} else
ret = 0; /* shouldn't get here */
}
+
if ((BINMODE & BINMODE_INPUT) != 0)
os_setbinmode(fileno(stdin), O_BINARY);
+#ifdef SIGPIPE
+ signal(SIGPIPE, SIG_IGN);
+#endif
cmd[tmp->stlen] = save;
}