Fix bug #25102
Mask SIGPIPE signal. boost.asio has a way to make sure it doesn't happen for its own operations but it doesn't apply to our sendfile call in campaignd. In fact, I see no way to prevent sendfile from sending SIGPIPE so masking it is the only way.
This commit is contained in:
parent
86e3161b29
commit
22fc02e9cb
1 changed files with 9 additions and 0 deletions
|
@ -112,6 +112,15 @@ server::server(const std::string& cfg_file)
|
|||
, blacklist_file_()
|
||||
, flush_timer_(io_service_)
|
||||
{
|
||||
|
||||
#ifndef _WIN32
|
||||
struct sigaction sa;
|
||||
std::memset( &sa, 0, sizeof(sa) );
|
||||
sa.sa_handler = SIG_IGN;
|
||||
int res = sigaction( SIGPIPE, &sa, NULL);
|
||||
assert( res == 0 );
|
||||
#endif
|
||||
|
||||
load_config();
|
||||
|
||||
LOG_CS << "Port: " << port_ << "\n";
|
||||
|
|
Loading…
Add table
Reference in a new issue