diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2016-05-12 21:43:48 +0300 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2016-05-12 21:43:48 +0300 |
commit | b2b81414cc6f4c2c4b5539a680c074c8c4592af7 (patch) | |
tree | 2061a3559e8e878d875a0135ac7ebae89448caa9 /builtin.c | |
parent | fec6265dfb087ecc8a26a9d8917bcd05bb4b1860 (diff) | |
download | egawk-b2b81414cc6f4c2c4b5539a680c074c8c4592af7.tar.gz egawk-b2b81414cc6f4c2c4b5539a680c074c8c4592af7.tar.bz2 egawk-b2b81414cc6f4c2c4b5539a680c074c8c4592af7.zip |
Fix issues with SIGPIPE.
Diffstat (limited to 'builtin.c')
-rw-r--r-- | builtin.c | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -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; } |