diff options
author | Martin Storsjö <martin@martin.st> | 2012-06-19 15:37:06 +0300 |
---|---|---|
committer | Martin Storsjö <martin@martin.st> | 2012-06-19 20:24:55 +0300 |
commit | a840cdda6cf7dbfe6858739f718d2ede9e3c375b (patch) | |
tree | 72a9bf7d609c33992f185f10489eea68229b21e8 /libavformat/tcp.c | |
parent | 860b40f1f2f5ed2cda0f4a8f44a631ffd2f94482 (diff) | |
download | ffmpeg-a840cdda6cf7dbfe6858739f718d2ede9e3c375b.tar.gz |
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>
Diffstat (limited to 'libavformat/tcp.c')
-rw-r--r-- | libavformat/tcp.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libavformat/tcp.c b/libavformat/tcp.c index 7e348f7729..e7c6210fc1 100644 --- a/libavformat/tcp.c +++ b/libavformat/tcp.c @@ -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; } } |