mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-01-20 20:50:44 +00:00
[BUG] init: unconditionally catch SIGPIPE
Apparently some systems define MSG_NOSIGNAL but do not necessarily check it (or maybe binaries are built somewhere and used on older versions). There were reports of very recent FreeBSD setups causing SIGPIPEs, while older ones catch the signal. Recent FreeBSD manpages indeed define MSG_NOSIGNAL. So let's now unconditionnaly catch the signal. It's useless not to do it for the rare cases where it's not needed (linux 2.4 and below).
This commit is contained in:
parent
bf3f1de5b5
commit
e437c44483
@ -995,12 +995,11 @@ int main(int argc, char **argv)
|
||||
signal_register(SIGTERM, sig_term);
|
||||
#endif
|
||||
|
||||
/* on very high loads, a sigpipe sometimes happen just between the
|
||||
* getsockopt() which tells "it's OK to write", and the following write :-(
|
||||
/* Always catch SIGPIPE even on platforms which define MSG_NOSIGNAL.
|
||||
* Some recent FreeBSD setups report broken pipes, and MSG_NOSIGNAL
|
||||
* was defined there, so let's stay on the safe side.
|
||||
*/
|
||||
#if !MSG_NOSIGNAL || defined(CONFIG_HAP_LINUX_SPLICE)
|
||||
signal(SIGPIPE, SIG_IGN);
|
||||
#endif
|
||||
|
||||
/* We will loop at most 100 times with 10 ms delay each time.
|
||||
* That's at most 1 second. We only send a signal to old pids
|
||||
|
Loading…
Reference in New Issue
Block a user