summaryrefslogtreecommitdiff
path: root/libavformat/udp.c
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2011-02-19 19:14:11 +0100
committerRonald S. Bultje <rsbultje@gmail.com>2011-02-23 07:21:31 -0500
commit28c4741a6617a4c1d2490cb13fc70ae4c9c472da (patch)
tree492c04df564f16ba9fd634c29eb4ea69154dab87 /libavformat/udp.c
parent8f935b9271052be8f97d655081b94b68b6c23bfb (diff)
downloadffmpeg-28c4741a6617a4c1d2490cb13fc70ae4c9c472da.tar.gz
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 <rsbultje@gmail.com>
Diffstat (limited to 'libavformat/udp.c')
-rw-r--r--libavformat/udp.c10
1 files changed, 5 insertions, 5 deletions
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;