X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=rts%2Fposix%2FSignals.c;h=e723b8ff0a469d199148bdc9b743dca6c53ae16a;hb=4d8c7c976104d2e39a1183967ec0f254a0fc0a47;hp=b045289ce6fec2b65188d0db64534199ef10148d;hpb=401140734891ca804c336122581743251d61b3a6;p=ghc-hetmet.git diff --git a/rts/posix/Signals.c b/rts/posix/Signals.c index b045289..e723b8f 100644 --- a/rts/posix/Signals.c +++ b/rts/posix/Signals.c @@ -471,6 +471,15 @@ shutdown_handler(int sig STG_UNUSED) } /* ----------------------------------------------------------------------------- + * An empty signal handler, currently used for SIGPIPE + * -------------------------------------------------------------------------- */ +static void +empty_handler (int sig STG_UNUSED) +{ + // nothing +} + +/* ----------------------------------------------------------------------------- * Install default signal handlers. * * The RTS installs a default signal handler for catching @@ -526,7 +535,9 @@ initDefaultHandlers(void) #endif // ignore SIGPIPE; see #1619 - action.sa_handler = SIG_IGN; + // actually, we use an empty signal handler rather than SIG_IGN, + // so that SIGPIPE gets reset to its default behaviour on exec. + action.sa_handler = empty_handler; sigemptyset(&action.sa_mask); action.sa_flags = 0; if (sigaction(SIGPIPE, &action, &oact) != 0) {