]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/network.c
Merge commit 'c011beda2611acfeb6f67d4fdf30d1eceed9e62f'
[ffmpeg] / libavformat / network.c
index d5c82e9ab9ba83645c97a13d4bc2857dea1b0775..4bae7e2e446367a5009f7ba5c98aae8233a7e624 100644 (file)
@@ -194,8 +194,11 @@ int ff_socket(int af, int type, int proto)
 #endif
     }
 #ifdef SO_NOSIGPIPE
-    if (fd != -1)
-        setsockopt(fd, SOL_SOCKET, SO_NOSIGPIPE, &(int){1}, sizeof(int));
+    if (fd != -1) {
+        if (setsockopt(fd, SOL_SOCKET, SO_NOSIGPIPE, &(int){1}, sizeof(int))) {
+             av_log(NULL, AV_LOG_WARNING, "setsockopt(SO_NOSIGPIPE) failed\n");
+        }
+    }
 #endif
     return fd;
 }
@@ -346,3 +349,10 @@ int ff_http_match_no_proxy(const char *no_proxy, const char *hostname)
     av_free(buf);
     return ret;
 }
+
+void ff_log_net_error(void *ctx, int level, const char* prefix)
+{
+    char errbuf[100];
+    av_strerror(ff_neterrno(), errbuf, sizeof(errbuf));
+    av_log(ctx, level, "%s: %s\n", prefix, errbuf);
+}