We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 226ef47 commit d6f6dbaCopy full SHA for d6f6dba
src/tcpresolver.h
@@ -112,12 +112,9 @@ class TcpResolver : public TcpState
112
// connection succeeded, mark socket as non-blocking
113
if (_socket >= 0)
114
{
115
- // turn socket into a non-blocking socket
116
- fcntl(_socket, F_SETFL, O_NONBLOCK);
+ // turn socket into a non-blocking socket and set the close-on-exec bit
+ fcntl(_socket, F_SETFL, O_NONBLOCK | O_CLOEXEC);
117
118
- // switch on the close-on-exec bit
119
- fcntl(_socket, F_SETFL, O_CLOEXEC);
120
-
121
// we want to enable "nodelay" on sockets (otherwise all send operations are s-l-o-w
122
int optval = 1;
123
0 commit comments