mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-12-15 19:40:07 +01:00
network: Use av_strerror for getting error messages
Also use ff_neterrno() instead of errno directly (which doesn't work on windows), for getting the error code. Signed-off-by: Martin Storsjö <martin@martin.st>
This commit is contained in:
@@ -141,10 +141,12 @@ static int tcp_open(URLContext *h, const char *uri, int flags)
|
||||
optlen = sizeof(ret);
|
||||
getsockopt (fd, SOL_SOCKET, SO_ERROR, &ret, &optlen);
|
||||
if (ret != 0) {
|
||||
char errbuf[100];
|
||||
ret = AVERROR(ret);
|
||||
av_strerror(ret, errbuf, sizeof(errbuf));
|
||||
av_log(h, AV_LOG_ERROR,
|
||||
"TCP connection to %s:%d failed: %s\n",
|
||||
hostname, port, strerror(ret));
|
||||
ret = AVERROR(ret);
|
||||
hostname, port, errbuf);
|
||||
goto fail;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user