From c30a17ac8a512de505357199776ddfaa50d0c6e4 Mon Sep 17 00:00:00 2001 From: Lee Salzman Date: Mon, 20 May 2024 14:19:30 -0400 Subject: [PATCH] return -2 for EINTR --- unix.c | 4 +++- win32.c | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/unix.c b/unix.c index a7bd048..a66bc33 100644 --- a/unix.c +++ b/unix.c @@ -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; } diff --git a/win32.c b/win32.c index 462e242..578a322 100644 --- a/win32.c +++ b/win32.c @@ -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)