From 28c4741a6617a4c1d2490cb13fc70ae4c9c472da Mon Sep 17 00:00:00 2001 From: Martin Storsjö Date: Sat, 19 Feb 2011 19:14:11 +0100 Subject: libavformat: Remove FF_NETERRNO() Map EAGAIN and EINTR from ff_neterrno to the normal AVERROR() error codes. Provide fallback definitions of other errno.h network errors, mapping them to the corresponding winsock errors. This eases catching these error codes in common code, without having to distinguish between FF_NETERRNO(EAGAIN) and AVERROR(EAGAIN). This fixes roundup issue 2614, unbreaking blocking network IO on windows. Signed-off-by: Ronald S. Bultje --- libavformat/udp.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'libavformat/udp.c') diff --git a/libavformat/udp.c b/libavformat/udp.c index 6c1b37b59d..0196573209 100644 --- a/libavformat/udp.c +++ b/libavformat/udp.c @@ -455,7 +455,7 @@ static int udp_read(URLContext *h, uint8_t *buf, int size) return AVERROR(EINTR); ret = poll(&p, 1, 100); if (ret < 0) { - if (ff_neterrno() == FF_NETERROR(EINTR)) + if (ff_neterrno() == AVERROR(EINTR)) continue; return AVERROR(EIO); } @@ -463,8 +463,8 @@ static int udp_read(URLContext *h, uint8_t *buf, int size) continue; len = recv(s->udp_fd, buf, size, 0); if (len < 0) { - if (ff_neterrno() != FF_NETERROR(EAGAIN) && - ff_neterrno() != FF_NETERROR(EINTR)) + if (ff_neterrno() != AVERROR(EAGAIN) && + ff_neterrno() != AVERROR(EINTR)) return AVERROR(EIO); } else { break; @@ -486,8 +486,8 @@ static int udp_write(URLContext *h, const uint8_t *buf, int size) } else ret = send(s->udp_fd, buf, size, 0); if (ret < 0) { - if (ff_neterrno() != FF_NETERROR(EINTR) && - ff_neterrno() != FF_NETERROR(EAGAIN)) + if (ff_neterrno() != AVERROR(EINTR) && + ff_neterrno() != AVERROR(EAGAIN)) return ff_neterrno(); } else { break; -- cgit v1.2.3