]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: signal: really ignore signals configured with no handler
authorWilly Tarreau <w@1wt.eu>
Thu, 4 Oct 2012 17:19:36 +0000 (19:19 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 4 Oct 2012 20:26:09 +0000 (22:26 +0200)
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.

src/signal.c

index 128a3838fb27443bf8a2beeadfe4bf07457bf3c1..e1f5a8373fbcdb06a942d9be28e44061529d4888 100644 (file)
@@ -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;