From: Mikko Rasa Date: Tue, 5 Dec 2017 06:39:14 +0000 (+0200) Subject: Fix a flag handling bug in Socket::Private::set_block X-Git-Url: http://git.tdb.fi/?p=libs%2Fnet.git;a=commitdiff_plain;h=070af154a0cbced60ea4ca7072df9b51338e2caa Fix a flag handling bug in Socket::Private::set_block --- 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)