mirror of
https://github.com/cuberite/libevent.git
synced 2025-09-11 13:24:43 -04:00
Adjusted fcntl() retval comparison on evutil_make_socket_nonblocking().
Apparently, a successful return value on F_SETFL is "anything but -1".
This commit is contained in:
parent
5a43df82b8
commit
4df7dbcbdf
6
evutil.c
6
evutil.c
@ -187,11 +187,11 @@ evutil_make_socket_nonblocking(evutil_socket_t fd)
|
|||||||
{
|
{
|
||||||
long flags;
|
long flags;
|
||||||
if ((flags = fcntl(fd, F_GETFL, NULL)) < 0) {
|
if ((flags = fcntl(fd, F_GETFL, NULL)) < 0) {
|
||||||
event_warn("fcntl(F_GETFL)");
|
event_warn("fcntl(%d, F_GETFL)", fd);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (fcntl(fd, F_SETFL, flags | O_NONBLOCK) < 0) {
|
if (fcntl(fd, F_SETFL, flags | O_NONBLOCK) == -1) {
|
||||||
event_warn("fcntl(O_NONBLOCK)");
|
event_warn("fcntl(%d, F_SETFL)", fd);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user