Commit 4136409a authored by diego's avatar diego

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


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@19433 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent fcb4a6d3
...@@ -130,7 +130,7 @@ static int tcp_read(URLContext *h, uint8_t *buf, int size) ...@@ -130,7 +130,7 @@ static int tcp_read(URLContext *h, uint8_t *buf, int size)
if (len < 0) { if (len < 0) {
if (ff_neterrno() != FF_NETERROR(EINTR) && if (ff_neterrno() != FF_NETERROR(EINTR) &&
ff_neterrno() != FF_NETERROR(EAGAIN)) ff_neterrno() != FF_NETERROR(EAGAIN))
return AVERROR(errno); return AVERROR(ff_neterrno());
} else return len; } else return len;
} else if (ret < 0) { } else if (ret < 0) {
return -1; return -1;
...@@ -160,7 +160,7 @@ static int tcp_write(URLContext *h, uint8_t *buf, int size) ...@@ -160,7 +160,7 @@ static int tcp_write(URLContext *h, uint8_t *buf, int size)
if (len < 0) { if (len < 0) {
if (ff_neterrno() != FF_NETERROR(EINTR) && if (ff_neterrno() != FF_NETERROR(EINTR) &&
ff_neterrno() != FF_NETERROR(EAGAIN)) ff_neterrno() != FF_NETERROR(EAGAIN))
return AVERROR(errno); return AVERROR(ff_neterrno());
continue; continue;
} }
size -= len; size -= len;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment