aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/network.c
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2018-09-11 13:17:38 -0300
committerJames Almer <jamrial@gmail.com>2018-09-11 13:17:38 -0300
commit03210fe138f3b3bd7f5272fe29aca810cf517329 (patch)
tree64a2be59ededd292e37447fe8db0f21bbb0ac4ac /libavformat/network.c
parent5c1aafff2d844b177b0b20db4a38d8460992558b (diff)
parent22f98ac19cf29f22b3e1d10314df9503f06fe683 (diff)
downloadffmpeg-03210fe138f3b3bd7f5272fe29aca810cf517329.tar.gz
Merge commit '22f98ac19cf29f22b3e1d10314df9503f06fe683'
* commit '22f98ac19cf29f22b3e1d10314df9503f06fe683': network: Check for EINTR in ff_poll_interrupt Merged-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavformat/network.c')
-rw-r--r--libavformat/network.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/libavformat/network.c b/libavformat/network.c
index 4bae7e2e44..c97e59d620 100644
--- a/libavformat/network.c
+++ b/libavformat/network.c
@@ -165,14 +165,17 @@ static int ff_poll_interrupt(struct pollfd *p, nfds_t nfds, int timeout,
if (ff_check_interrupt(cb))
return AVERROR_EXIT;
ret = poll(p, nfds, POLLING_TIME);
- if (ret != 0)
+ if (ret != 0) {
+ if (ret < 0)
+ ret = ff_neterrno();
+ if (ret == AVERROR(EINTR))
+ continue;
break;
+ }
} while (timeout <= 0 || runs-- > 0);
if (!ret)
return AVERROR(ETIMEDOUT);
- if (ret < 0)
- return ff_neterrno();
return ret;
}