From: Willy Tarreau Date: Thu, 4 Oct 2012 17:19:36 +0000 (+0200) Subject: MINOR: signal: really ignore signals configured with no handler X-Git-Tag: v1.5-dev13~225 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c39b0d17f2846c99af0b6f8d42be08afee0134dc;p=thirdparty%2Fhaproxy.git MINOR: signal: really ignore signals configured with no handler Until now, signals configured with no handler were still enabled and ignored upon signal reception. Until now it was not an issue but with SSL causing many EPIPE all the time, it becomes obvious that signal processing comes with a cost. So set the handler to SIG_IGN when the function is NULL. --- diff --git a/src/signal.c b/src/signal.c index 128a3838fb..e1f5a8373f 100644 --- a/src/signal.c +++ b/src/signal.c @@ -144,7 +144,7 @@ struct sig_handler *signal_register_fct(int sig, void (*fct)(struct sig_handler return NULL; if (sig) - signal(sig, signal_handler); + signal(sig, fct ? signal_handler : SIG_IGN); if (!fct) return NULL;