Discussion:
[PATCH 2/3] network: Use ff_neterrno instead of AVERROR(errno) for poll errors
(too old to reply)
Martin Storsjö
2018-08-13 19:30:14 UTC
Permalink
From: Simon Thelen <ffmpeg-***@c-14.de>

This makes sure to pick up the actual error codes on windows.
---
libavformat/network.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/network.c b/libavformat/network.c
index 86d79553f7..1e02668ecf 100644
--- a/libavformat/network.c
+++ b/libavformat/network.c
@@ -138,7 +138,7 @@ static int ff_poll_interrupt(struct pollfd *p, nfds_t nfds, int timeout,
if (!ret)
return AVERROR(ETIMEDOUT);
if (ret < 0)
- return AVERROR(errno);
+ return ff_neterrno();
return ret;
}
--
2.15.2 (Apple Git-101.1)
Martin Storsjö
2018-08-13 19:30:15 UTC
Permalink
---
libavformat/network.c | 9 ++++++---
1 file 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;
}
--
2.15.2 (Apple Git-101.1)
Luca Barbato
2018-08-14 11:56:26 UTC
Permalink
Set ok.

Loading...