]> git.sesse.net Git - vlc/blobdiff - src/network/tcp.c
EWOULDBLOCK may be used instead of EAGAIN for read, recv and accept
[vlc] / src / network / tcp.c
index fe273759411bebe619beb5e02c36fd9779a5de73..4f9fa36ad9aef186b708963ee219527342b1c25c 100644 (file)
@@ -52,6 +52,8 @@
 #if defined (WIN32) || defined (UNDER_CE)
 #   undef EINPROGRESS
 #   define EINPROGRESS WSAEWOULDBLOCK
+#   undef EWOULDBLOCK
+#   define EWOULDBLOCK WSAEWOULDBLOCK
 #   undef EINTR
 #   define EINTR WSAEINTR
 #   undef ETIMEDOUT
@@ -258,7 +260,7 @@ int net_AcceptSingle (vlc_object_t *obj, int lfd)
 
     if (fd == -1)
     {
-        if (net_errno != EAGAIN)
+        if (net_errno != EAGAIN && net_errno != EWOULDBLOCK)
             msg_Err (obj, "accept failed (from socket %d): %m", lfd);
         return -1;
     }
@@ -279,9 +281,6 @@ int __net_Accept( vlc_object_t *p_this, int *pi_fd, mtime_t i_wait )
     int timeout = (i_wait < 0) ? -1 : i_wait / 1000;
     int evfd = vlc_object_waitpipe (p_this);
 
-    if (evfd == -1)
-        return -1;
-
     assert( pi_fd != NULL );
 
     for (;;)