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

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

parent de2c8c11
...@@ -379,6 +379,9 @@ __net_Read (vlc_object_t *restrict p_this, int fd, const v_socket_t *vs, ...@@ -379,6 +379,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
...@@ -258,7 +260,7 @@ int net_AcceptSingle (vlc_object_t *obj, int lfd) ...@@ -258,7 +260,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