return -2 for EINTR

This commit is contained in:
Lee Salzman 2024-05-20 14:19:30 -04:00
parent 80103c873d
commit c30a17ac8a
2 changed files with 6 additions and 4 deletions

4
unix.c
View file

@ -504,8 +504,10 @@ enet_socket_receive (ENetSocket socket,
switch (errno) switch (errno)
{ {
case EWOULDBLOCK: case EWOULDBLOCK:
case EINTR:
return 0; return 0;
case EINTR:
case EMSGSIZE:
return -2;
default: default:
return -1; return -1;
} }

View file

@ -381,13 +381,13 @@ enet_socket_receive (ENetSocket socket,
{ {
case WSAEWOULDBLOCK: case WSAEWOULDBLOCK:
case WSAECONNRESET: case WSAECONNRESET:
case WSAEINTR:
return 0; return 0;
case WSAEINTR:
case WSAEMSGSIZE: case WSAEMSGSIZE:
return -2; return -2;
default:
return -1;
} }
return -1;
} }
if (flags & MSG_PARTIAL) if (flags & MSG_PARTIAL)