From: Mikko Rasa Date: Sat, 21 Sep 2019 15:06:36 +0000 (+0300) Subject: Fix the polarity of O_CLOEXEC for Socket X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=b97d82a641331b097d6ae973d0a99a3818e9ccc2;p=libs%2Fnet.git Fix the polarity of O_CLOEXEC for Socket --- diff --git a/source/net/unix/socket.cpp b/source/net/unix/socket.cpp index a9e9c58..970b9ae 100644 --- a/source/net/unix/socket.cpp +++ b/source/net/unix/socket.cpp @@ -44,7 +44,7 @@ void Socket::Private::set_block(bool b) void Socket::Private::set_inherit(bool i) { int flags = fcntl(handle, F_GETFD); - fcntl(handle, F_SETFD, (flags&~O_CLOEXEC)|(i?O_CLOEXEC:0)); + fcntl(handle, F_SETFD, (flags&~O_CLOEXEC)|(i?0:O_CLOEXEC)); } int Socket::Private::set_option(int level, int optname, const void *optval, socklen_t optlen)