[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:14 CET 2009
vlc | branch: master | Rémi Denis-Courmont <rdenis at simphalempin.com> | Sat Jan 3 22:59:33 2009 +0200| [aa8356607732152ca53797cda46d56abf4d6ed73] | committer: Rémi Denis-Courmont
EWOULDBLOCK may be used instead of EAGAIN for read, recv and accept
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=aa8356607732152ca53797cda46d56abf4d6ed73
---
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 3a39de0..2c1c80e 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 814808d..4f9fa36 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;
}
More information about the vlc-devel
mailing list