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:
loonycyborg 2016-09-23 16:27:30 +03:00
parent 86e3161b29
commit 22fc02e9cb

View file

@ -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";