From 226ef47beb597e9355b94550454f0ec9b6e9f4df Mon Sep 17 00:00:00 2001 From: Emiel Bruijntjes Date: Mon, 14 Dec 2015 20:20:03 +0100 Subject: [PATCH] socket connections have close-on-exit bit set --- src/tcpresolver.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/tcpresolver.h b/src/tcpresolver.h index e16d626..35475a8 100644 --- a/src/tcpresolver.h +++ b/src/tcpresolver.h @@ -114,6 +114,9 @@ private: { // turn socket into a non-blocking socket fcntl(_socket, F_SETFL, O_NONBLOCK); + + // switch on the close-on-exec bit + fcntl(_socket, F_SETFL, O_CLOEXEC); // we want to enable "nodelay" on sockets (otherwise all send operations are s-l-o-w int optval = 1;