wesnothd: Properly enable cloexec even on non-keepalive codepath
This commit is contained in:
parent
ada186769b
commit
63c72ea42b
1 changed files with 4 additions and 1 deletions
|
@ -136,7 +136,6 @@ void server_base::serve(boost::asio::yield_context yield, boost::asio::ip::tcp::
|
|||
setsockopt(socket->native_handle(), SOL_TCP, TCP_KEEPIDLE, &timeout, sizeof(timeout));
|
||||
setsockopt(socket->native_handle(), SOL_TCP, TCP_KEEPCNT, &cnt, sizeof(cnt));
|
||||
setsockopt(socket->native_handle(), SOL_TCP, TCP_KEEPINTVL, &interval, sizeof(interval));
|
||||
fcntl(socket->native_handle(), F_SETFD, FD_CLOEXEC);
|
||||
#endif
|
||||
#if defined(__APPLE__) && defined(__MACH__)
|
||||
setsockopt(socket->native_handle(), IPPROTO_TCP, TCP_KEEPALIVE, &timeout, sizeof(timeout));
|
||||
|
@ -144,6 +143,10 @@ void server_base::serve(boost::asio::yield_context yield, boost::asio::ip::tcp::
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifdef __linux__
|
||||
fcntl(socket->native_handle(), F_SETFD, FD_CLOEXEC);
|
||||
#endif
|
||||
|
||||
DBG_SERVER << client_address(socket) << "\tnew connection tentatively accepted\n";
|
||||
|
||||
uint32_t protocol_version;
|
||||
|
|
Loading…
Add table
Reference in a new issue