mirror of
https://github.com/wesnoth/wesnoth
synced 2025-04-25 11:57:19 +00:00
wesnothd: Properly enable cloexec even on non-keepalive codepath
This commit is contained in:
parent
b55a33fd2b
commit
2dcd7ca0fb
@ -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…
x
Reference in New Issue
Block a user