diff options
author | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2009-03-02 17:35:03 +0300 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2009-03-02 17:35:03 +0300 |
commit | 186f9ab430c1f20efb595da504570fd0b575836a (patch) | |
tree | a38d6864f48615d0a23ebab01c605987e01d2fb3 /src/util.c | |
parent | 13d4ef61a37119a0853e6570a827e5bd60bfa06f (diff) | |
download | rspamd-186f9ab430c1f20efb595da504570fd0b575836a.tar.gz rspamd-186f9ab430c1f20efb595da504570fd0b575836a.zip |
* Properly set initial state for surbl state machine
* Ignore SIGPIPE globally as dispatcher performs check of all write (2) calls
Diffstat (limited to 'src/util.c')
-rw-r--r-- | src/util.c | 7 |
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 |