mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-20 19:45:12 +00:00
LibCore: CSocket::set_blocking() was backwards
This commit is contained in:
parent
537a1d31c5
commit
8e7e502f37
Notes:
sideshowbarker
2024-07-19 09:48:34 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/8e7e502f378
1 changed files with 5 additions and 3 deletions
|
@ -36,6 +36,8 @@
|
|||
#include <sys/socket.h>
|
||||
#include <unistd.h>
|
||||
|
||||
//#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)
|
||||
|
|
Loading…
Add table
Reference in a new issue