Commit 91571ec6 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

EWOULDBLOCK may be used instead of EAGAIN for read, recv and accept

(cherry picked from commit aa835660)
parent 7bf96e77
...@@ -375,6 +375,9 @@ __net_Read (vlc_object_t *restrict p_this, int fd, const v_socket_t *vs, ...@@ -375,6 +375,9 @@ __net_Read (vlc_object_t *restrict p_this, int fd, const v_socket_t *vs,
switch (errno) switch (errno)
{ {
case EAGAIN: /* spurious wakeup or no TLS data */ case EAGAIN: /* spurious wakeup or no TLS data */
#if (EAGAIN != EWOULDBLOCK)
case EWOULDBLOCK:
#endif
case EINTR: /* asynchronous signal */ case EINTR: /* asynchronous signal */
continue; continue;
} }
......
...@@ -52,6 +52,8 @@ ...@@ -52,6 +52,8 @@
#if defined (WIN32) || defined (UNDER_CE) #if defined (WIN32) || defined (UNDER_CE)
# undef EINPROGRESS # undef EINPROGRESS
# define EINPROGRESS WSAEWOULDBLOCK # define EINPROGRESS WSAEWOULDBLOCK
# undef EWOULDBLOCK
# define EWOULDBLOCK WSAEWOULDBLOCK
# undef EINTR # undef EINTR
# define EINTR WSAEINTR # define EINTR WSAEINTR
# undef ETIMEDOUT # undef ETIMEDOUT
...@@ -256,7 +258,7 @@ int net_AcceptSingle (vlc_object_t *obj, int lfd) ...@@ -256,7 +258,7 @@ int net_AcceptSingle (vlc_object_t *obj, int lfd)
if (fd == -1) if (fd == -1)
{ {
if (net_errno != EAGAIN) if (net_errno != EAGAIN && net_errno != EWOULDBLOCK)
msg_Err (obj, "accept failed (from socket %d): %m", lfd); msg_Err (obj, "accept failed (from socket %d): %m", lfd);
return -1; return -1;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment