From: RĂ©mi Denis-Courmont Date: Sat, 3 Jan 2009 20:59:33 +0000 (+0200) Subject: EWOULDBLOCK may be used instead of EAGAIN for read, recv and accept X-Git-Tag: 1.0.0-pre1~1574 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=aa8356607732152ca53797cda46d56abf4d6ed73;p=vlc EWOULDBLOCK may be used instead of EAGAIN for read, recv and accept --- diff --git a/src/network/io.c b/src/network/io.c index 3a39de07b4..2c1c80e467 100644 --- a/src/network/io.c +++ b/src/network/io.c @@ -379,6 +379,9 @@ __net_Read (vlc_object_t *restrict p_this, int fd, const v_socket_t *vs, switch (errno) { case EAGAIN: /* spurious wakeup or no TLS data */ +#if (EAGAIN != EWOULDBLOCK) + case EWOULDBLOCK: +#endif case EINTR: /* asynchronous signal */ continue; } diff --git a/src/network/tcp.c b/src/network/tcp.c index 814808d056..4f9fa36ad9 100644 --- a/src/network/tcp.c +++ b/src/network/tcp.c @@ -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; }