From 070af154a0cbced60ea4ca7072df9b51338e2caa Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Tue, 5 Dec 2017 08:39:14 +0200 Subject: [PATCH] Fix a flag handling bug in Socket::Private::set_block --- 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 02ef7c3..46c80b7 100644 --- a/source/net/unix/socket.cpp +++ b/source/net/unix/socket.cpp @@ -37,7 +37,7 @@ void Socket::set_platform_events(unsigned) void Socket::Private::set_block(bool b) { int flags = fcntl(handle, F_GETFL); - fcntl(handle, F_SETFL, (flags&O_NONBLOCK)|(b?0:O_NONBLOCK)); + fcntl(handle, F_SETFL, (flags&~O_NONBLOCK)|(b?0:O_NONBLOCK)); } int Socket::Private::set_option(int level, int optname, const void *optval, socklen_t optlen) -- 2.43.0