network: Check for EINTR in ff_poll_interrupt
authorMartin Storsjö <martin@martin.st>
Thu, 9 Aug 2018 18:30:48 +0000 (21:30 +0300)
committerMartin Storsjö <martin@martin.st>
Tue, 14 Aug 2018 19:30:33 +0000 (22:30 +0300)
Signed-off-by: Martin Storsjö <martin@martin.st>
libavformat/network.c

index 1e02668..24fcf20 100644 (file)
@@ -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;
 }