mirror of
https://github.com/cuberite/libevent.git
synced 2025-08-04 01:36:23 -04:00
Do not check O_NONBLOCK for invalid fds
Fixes: 6f988ee1 ("Merge branch 'check-O_NONBLOCK-in-debug'") (cherry picked from commit 9d3a415a99bbc6a7e0f0b12ae3c6c5c7e4613cf1)
This commit is contained in:
parent
f9c5d17b0a
commit
a8155c62d8
13
event.c
13
event.c
@ -373,17 +373,18 @@ static void event_debug_assert_not_added_(const struct event *ev)
|
|||||||
}
|
}
|
||||||
static void event_debug_assert_socket_nonblocking_(evutil_socket_t fd)
|
static void event_debug_assert_socket_nonblocking_(evutil_socket_t fd)
|
||||||
{
|
{
|
||||||
int flags;
|
|
||||||
|
|
||||||
if (!event_debug_mode_on_)
|
if (!event_debug_mode_on_)
|
||||||
return;
|
return;
|
||||||
|
if (fd < 0)
|
||||||
|
return;
|
||||||
|
|
||||||
#ifndef _WIN32
|
#ifndef _WIN32
|
||||||
if ((flags = fcntl(fd, F_GETFL, NULL)) >= 0) {
|
{
|
||||||
EVUTIL_ASSERT(flags & O_NONBLOCK);
|
int flags;
|
||||||
|
if ((flags = fcntl(fd, F_GETFL, NULL)) >= 0) {
|
||||||
|
EVUTIL_ASSERT(flags & O_NONBLOCK);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
(void)flags;
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user