[vlc-devel] commit: EWOULDBLOCK may be used instead of EAGAIN for read, recv and accept ( Rémi Denis-Courmont )
git version control
git at videolan.org
Sat Jan 3 22:00:56 CET 2009
vlc | branch: 0.9-bugfix | Rémi Denis-Courmont <rdenis at simphalempin.com> | Sat Jan 3 22:59:33 2009 +0200| [91571ec63a7a52d8d24f19577f1349213e81ac69] | committer: Rémi Denis-Courmont
EWOULDBLOCK may be used instead of EAGAIN for read, recv and accept
(cherry picked from commit aa8356607732152ca53797cda46d56abf4d6ed73)
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=91571ec63a7a52d8d24f19577f1349213e81ac69
---
src/network/io.c | 3 +++
src/network/tcp.c | 4 +++-
2 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/src/network/io.c b/src/network/io.c
index afe46a7..5fda122 100644
--- a/src/network/io.c
+++ b/src/network/io.c
@@ -375,6 +375,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 e027e27..796421b 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
@@ -256,7 +258,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;
}
More information about the vlc-devel
mailing list