[FFmpeg-cvslog] r19433 - trunk/libavformat/tcp.c

diego subversion
Wed Jul 15 07:52:49 CEST 2009


Author: diego
Date: Wed Jul 15 07:52:49 2009
New Revision: 19433

Log:
Use ff_neterrno instead of errno in tcp.c.
If ff_neterrno() is checked instead of errno, that's probably what should be
used in the return value.
As a sideeffect, this gives better compatibility with Windows (CE), where
network errors aren't visible in errno.)
patch by Martin Storsj?, martin martin st

Modified:
   trunk/libavformat/tcp.c

Modified: trunk/libavformat/tcp.c
==============================================================================
--- trunk/libavformat/tcp.c	Wed Jul 15 01:12:43 2009	(r19432)
+++ trunk/libavformat/tcp.c	Wed Jul 15 07:52:49 2009	(r19433)
@@ -130,7 +130,7 @@ static int tcp_read(URLContext *h, uint8
             if (len < 0) {
                 if (ff_neterrno() != FF_NETERROR(EINTR) &&
                     ff_neterrno() != FF_NETERROR(EAGAIN))
-                    return AVERROR(errno);
+                    return AVERROR(ff_neterrno());
             } else return len;
         } else if (ret < 0) {
             return -1;
@@ -160,7 +160,7 @@ static int tcp_write(URLContext *h, uint
             if (len < 0) {
                 if (ff_neterrno() != FF_NETERROR(EINTR) &&
                     ff_neterrno() != FF_NETERROR(EAGAIN))
-                    return AVERROR(errno);
+                    return AVERROR(ff_neterrno());
                 continue;
             }
             size -= len;



More information about the ffmpeg-cvslog mailing list