aboutsummaryrefslogtreecommitdiffstats
path: root/src/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/util.c')
-rw-r--r--src/util.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/util.c b/src/util.c
index afcb13b23..fac109c78 100644
--- a/src/util.c
+++ b/src/util.c
@@ -165,6 +165,7 @@ write_pid (struct rspamd_main *main)
void
init_signals (struct sigaction *signals, sig_t sig_handler)
{
+ struct sigaction sigpipe_act;
/* Setting up signal handlers */
/* SIGUSR1 - reopen config file */
/* SIGUSR2 - worker is ready for accept */
@@ -186,6 +187,12 @@ init_signals (struct sigaction *signals, sig_t sig_handler)
sigaction (SIGUSR1, signals, NULL);
sigaction (SIGUSR2, signals, NULL);
sigaction (SIGALRM, signals, NULL);
+
+ /* Ignore SIGPIPE as we handle write errors manually */
+ sigemptyset (&sigpipe_act.sa_mask);
+ sigaddset (&sigpipe_act.sa_mask, SIGPIPE);
+ sigpipe_act.sa_handler = SIG_IGN;
+ sigaction (SIGPIPE, &sigpipe_act, NULL);
}
void