Skip to content

Commit

Permalink
return -2 for EINTR
Browse files Browse the repository at this point in the history
  • Loading branch information
lsalzman committed May 20, 2024
1 parent 80103c8 commit c30a17a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion unix.c
Original file line number Diff line number Diff line change
Expand Up @@ -504,8 +504,10 @@ enet_socket_receive (ENetSocket socket,
switch (errno)
{
case EWOULDBLOCK:
case EINTR:
return 0;
case EINTR:
case EMSGSIZE:
return -2;
default:
return -1;
}
Expand Down
6 changes: 3 additions & 3 deletions win32.c
Original file line number Diff line number Diff line change
Expand Up @@ -381,13 +381,13 @@ enet_socket_receive (ENetSocket socket,
{
case WSAEWOULDBLOCK:
case WSAECONNRESET:
case WSAEINTR:
return 0;
case WSAEINTR:
case WSAEMSGSIZE:
return -2;
default:
return -1;
}

return -1;
}

if (flags & MSG_PARTIAL)
Expand Down

0 comments on commit c30a17a

Please sign in to comment.