mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 21:17:44 +00:00
LibCore: CSocket::set_blocking() was backwards
This commit is contained in:
parent
537a1d31c5
commit
8e7e502f37
1 changed files with 5 additions and 3 deletions
|
@ -36,6 +36,8 @@
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
|
//#define CSOCKET_DEBUG
|
||||||
|
|
||||||
CSocket::CSocket(Type type, CObject* parent)
|
CSocket::CSocket(Type type, CObject* parent)
|
||||||
: CIODevice(parent)
|
: CIODevice(parent)
|
||||||
, m_type(type)
|
, m_type(type)
|
||||||
|
@ -67,10 +69,10 @@ void CSocket::set_blocking(bool blocking)
|
||||||
int flags = fcntl(fd(), F_GETFL, 0);
|
int flags = fcntl(fd(), F_GETFL, 0);
|
||||||
ASSERT(flags >= 0);
|
ASSERT(flags >= 0);
|
||||||
if (blocking)
|
if (blocking)
|
||||||
flags = fcntl(fd(), F_SETFL, flags | O_NONBLOCK);
|
flags = fcntl(fd(), F_SETFL, flags & ~O_NONBLOCK);
|
||||||
else
|
else
|
||||||
flags = fcntl(fd(), F_SETFL, flags & O_NONBLOCK);
|
flags = fcntl(fd(), F_SETFL, flags | O_NONBLOCK);
|
||||||
ASSERT(flags >= 0);
|
ASSERT(flags == 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CSocket::connect(const CSocketAddress& address, int port)
|
bool CSocket::connect(const CSocketAddress& address, int port)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue