diff options
author | Gil Pedersen <gil@cmi.aau.dk> | 2011-04-28 10:27:40 +0300 |
---|---|---|
committer | Martin Storsjö <martin@martin.st> | 2011-04-28 10:28:51 +0300 |
commit | f2c85458c411447f006f9c928cb198ec0260255a (patch) | |
tree | 002c958572da0e2aeba9f82982f7aaf2bc2a3e8c /libavformat/network.h | |
parent | f8fec0505294a4c05e5cfd9323e04258db465314 (diff) | |
download | ffmpeg-f2c85458c411447f006f9c928cb198ec0260255a.tar.gz |
network: Check POLLERR and POLLHUP in ff_network_wait_fd
Previously, the function would lead to an infinite wait (by
returning AVERROR(EAGAIN)) on sockets indicating an error
via either of these poll flags.
Signed-off-by: Martin Storsjö <martin@martin.st>
Diffstat (limited to 'libavformat/network.h')
-rw-r--r-- | libavformat/network.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/network.h b/libavformat/network.h index 84a8f539d9..881384c943 100644 --- a/libavformat/network.h +++ b/libavformat/network.h @@ -78,7 +78,7 @@ static inline int ff_network_wait_fd(int fd, int write) struct pollfd p = { .fd = fd, .events = ev, .revents = 0 }; int ret; ret = poll(&p, 1, 100); - return ret < 0 ? ff_neterrno() : p.revents & ev ? 0 : AVERROR(EAGAIN); + return ret < 0 ? ff_neterrno() : p.revents & (ev | POLLERR | POLLHUP) ? 0 : AVERROR(EAGAIN); } static inline void ff_network_close(void) |