lavf/network: check return value of setsockopt.
authorJun Zhao <mypopydev@gmail.com>
Sun, 5 Aug 2018 12:19:28 +0000 (20:19 +0800)
committerJun Zhao <jun.zhao@intel.com>
Sat, 18 Aug 2018 08:16:11 +0000 (16:16 +0800)
Signed-off-by: Jun Zhao <mypopydev@gmail.com>
libavformat/network.c

index 21c836a..4bae7e2 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;
 }