From 8e7e502f37897382865ab052df4bd07a7268541e Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sun, 26 Jan 2020 14:28:22 +0100 Subject: [PATCH] LibCore: CSocket::set_blocking() was backwards --- Libraries/LibCore/CSocket.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Libraries/LibCore/CSocket.cpp b/Libraries/LibCore/CSocket.cpp index 034f33f299..135911b01c 100644 --- a/Libraries/LibCore/CSocket.cpp +++ b/Libraries/LibCore/CSocket.cpp @@ -36,6 +36,8 @@ #include #include +//#define CSOCKET_DEBUG + CSocket::CSocket(Type type, CObject* parent) : CIODevice(parent) , m_type(type) @@ -67,10 +69,10 @@ void CSocket::set_blocking(bool blocking) int flags = fcntl(fd(), F_GETFL, 0); ASSERT(flags >= 0); if (blocking) - flags = fcntl(fd(), F_SETFL, flags | O_NONBLOCK); + flags = fcntl(fd(), F_SETFL, flags & ~O_NONBLOCK); else - flags = fcntl(fd(), F_SETFL, flags & O_NONBLOCK); - ASSERT(flags >= 0); + flags = fcntl(fd(), F_SETFL, flags | O_NONBLOCK); + ASSERT(flags == 0); } bool CSocket::connect(const CSocketAddress& address, int port)