summaryrefslogtreecommitdiff
path: root/libavformat/tcp.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavformat/tcp.c')
-rw-r--r--libavformat/tcp.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavformat/tcp.c b/libavformat/tcp.c
index e7c6210fc1..f1bad847d0 100644
--- a/libavformat/tcp.c
+++ b/libavformat/tcp.c
@@ -139,7 +139,8 @@ static int tcp_open(URLContext *h, const char *uri, int flags)
}
/* test error */
optlen = sizeof(ret);
- getsockopt (fd, SOL_SOCKET, SO_ERROR, &ret, &optlen);
+ if (getsockopt (fd, SOL_SOCKET, SO_ERROR, &ret, &optlen))
+ ret = AVUNERROR(ff_neterrno());
if (ret != 0) {
char errbuf[100];
ret = AVERROR(ret);