]> git.tdb.fi Git - libs/net.git/blobdiff - source/net/unix/socket.cpp
Fix the polarity of O_CLOEXEC for Socket
[libs/net.git] / 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)