From b97d82a641331b097d6ae973d0a99a3818e9ccc2 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Sat, 21 Sep 2019 18:06:36 +0300 Subject: [PATCH] Fix the polarity of O_CLOEXEC for Socket --- source/net/unix/socket.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) -- 2.43.0