mirror of
https://github.com/lsalzman/enet
synced 2024-11-21 06:25:59 -07:00
fix ENET_SOCKOPT_NONBLOCK when value is 0
This commit is contained in:
parent
c8fa0aeea4
commit
4d2694d74e
1 changed files with 1 additions and 1 deletions
2
unix.c
2
unix.c
|
@ -246,7 +246,7 @@ enet_socket_set_option (ENetSocket socket, ENetSocketOption option, int value)
|
|||
{
|
||||
case ENET_SOCKOPT_NONBLOCK:
|
||||
#ifdef HAS_FCNTL
|
||||
result = fcntl (socket, F_SETFL, O_NONBLOCK | fcntl (socket, F_GETFL));
|
||||
result = fcntl (socket, F_SETFL, (value ? O_NONBLOCK : 0) | (fcntl (socket, F_GETFL) & ~O_NONBLOCK));
|
||||
#else
|
||||
result = ioctl (socket, FIONBIO, & value);
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue