]> git.tdb.fi Git - libs/net.git/commitdiff
Fix the polarity of O_CLOEXEC for Socket
authorMikko Rasa <tdb@tdb.fi>
Sat, 21 Sep 2019 15:06:36 +0000 (18:06 +0300)
committerMikko Rasa <tdb@tdb.fi>
Sat, 21 Sep 2019 15:06:36 +0000 (18:06 +0300)
source/net/unix/socket.cpp

index a9e9c58362d0f44faad9ae310157ecfd345e5c83..970b9aedd3be443dff55e6500a296719041ea678 100644 (file)
@@ -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)