From 80103c873dbda77a03f246822f1d63cfe4da854a Mon Sep 17 00:00:00 2001 From: Lee Salzman Date: Mon, 20 May 2024 14:06:47 -0400 Subject: [PATCH] check for EINTR --- unix.c | 12 ++++++++---- win32.c | 1 + 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/unix.c b/unix.c index 66692169..a7bd048b 100644 --- a/unix.c +++ b/unix.c @@ -501,10 +501,14 @@ enet_socket_receive (ENetSocket socket, if (recvLength == -1) { - if (errno == EWOULDBLOCK) - return 0; - - return -1; + switch (errno) + { + case EWOULDBLOCK: + case EINTR: + return 0; + default: + return -1; + } } #ifdef HAS_MSGHDR_FLAGS diff --git a/win32.c b/win32.c index f395c09b..462e2429 100644 --- a/win32.c +++ b/win32.c @@ -381,6 +381,7 @@ enet_socket_receive (ENetSocket socket, { case WSAEWOULDBLOCK: case WSAECONNRESET: + case WSAEINTR: return 0; case WSAEMSGSIZE: return -2;