summaryrefslogtreecommitdiff
path: root/libavformat/network.c
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2018-08-09 21:30:48 +0300
committerMartin Storsjö <martin@martin.st>2018-08-14 22:30:33 +0300
commit22f98ac19cf29f22b3e1d10314df9503f06fe683 (patch)
tree0922a0c8ae49d3be04c46db240c3dd12315170a2 /libavformat/network.c
parentc194b9ad6dbe65f5abd68158c4811ed84e2a2b95 (diff)
network: Check for EINTR in ff_poll_interrupt
Signed-off-by: Martin Storsjö <martin@martin.st>
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 1e02668ecf..24fcf20539 100644
--- a/libavformat/network.c
+++ b/libavformat/network.c
@@ -131,14 +131,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;
}