aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorLee Salzman <[email protected]>2024-05-20 14:06:47 -0400
committerLee Salzman <[email protected]>2024-05-20 14:06:47 -0400
commit80103c873dbda77a03f246822f1d63cfe4da854a (patch)
tree53a7b76a549ede585880b96c077c0de412ac62fb
parent4ce1625b8ae22a4e0030f07d80360e25ae558a1e (diff)
downloadenet-80103c873dbda77a03f246822f1d63cfe4da854a.tar.gz
enet-80103c873dbda77a03f246822f1d63cfe4da854a.zip
check for EINTR
-rw-r--r--unix.c12
-rw-r--r--win32.c1
2 files changed, 9 insertions, 4 deletions
diff --git a/unix.c b/unix.c
index 6669216..a7bd048 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 f395c09..462e242 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;