diff rtpproto.c @ 2056:eeea52739ff3 libavformat

use ff_neterrno() and FF_NETERROR() for networking error handling
author alex
date Fri, 27 Apr 2007 00:35:54 +0000
parents f67a8d12053d
children c5a3a1f884a4
line wrap: on
line diff
--- a/rtpproto.c	Thu Apr 26 23:44:56 2007 +0000
+++ b/rtpproto.c	Fri Apr 27 00:35:54 2007 +0000
@@ -178,7 +178,8 @@
         len = recvfrom (s->rtp_fd, buf, size, 0,
                         (struct sockaddr *)&from, &from_len);
         if (len < 0) {
-            if (errno == EAGAIN || errno == EINTR)
+            if (ff_neterrno() == FF_NETERROR(EAGAIN) ||
+                ff_neterrno() == FF_NETERROR(EINTR))
                 continue;
             return AVERROR_IO;
         }
@@ -201,7 +202,8 @@
                 len = recvfrom (s->rtcp_fd, buf, size, 0,
                                 (struct sockaddr *)&from, &from_len);
                 if (len < 0) {
-                    if (errno == EAGAIN || errno == EINTR)
+                    if (ff_neterrno() == FF_NETERROR(EAGAIN) ||
+                        ff_neterrno() == FF_NETERROR(EINTR))
                         continue;
                     return AVERROR_IO;
                 }
@@ -213,7 +215,8 @@
                 len = recvfrom (s->rtp_fd, buf, size, 0,
                                 (struct sockaddr *)&from, &from_len);
                 if (len < 0) {
-                    if (errno == EAGAIN || errno == EINTR)
+                    if (ff_neterrno() == FF_NETERROR(EAGAIN) ||
+                        ff_neterrno() == FF_NETERROR(EINTR))
                         continue;
                     return AVERROR_IO;
                 }