mirror of https://git.ffmpeg.org/ffmpeg.git
network: Check for EINTR in ff_poll_interrupt
Signed-off-by: Martin Storsjö <martin@martin.st>
This commit is contained in:
parent
c194b9ad6d
commit
22f98ac19c
|
@ -131,14 +131,17 @@ static int ff_poll_interrupt(struct pollfd *p, nfds_t nfds, int timeout,
|
||||||
if (ff_check_interrupt(cb))
|
if (ff_check_interrupt(cb))
|
||||||
return AVERROR_EXIT;
|
return AVERROR_EXIT;
|
||||||
ret = poll(p, nfds, POLLING_TIME);
|
ret = poll(p, nfds, POLLING_TIME);
|
||||||
if (ret != 0)
|
if (ret != 0) {
|
||||||
|
if (ret < 0)
|
||||||
|
ret = ff_neterrno();
|
||||||
|
if (ret == AVERROR(EINTR))
|
||||||
|
continue;
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
} while (timeout < 0 || runs-- > 0);
|
} while (timeout < 0 || runs-- > 0);
|
||||||
|
|
||||||
if (!ret)
|
if (!ret)
|
||||||
return AVERROR(ETIMEDOUT);
|
return AVERROR(ETIMEDOUT);
|
||||||
if (ret < 0)
|
|
||||||
return ff_neterrno();
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue