]> git.sesse.net Git - ffmpeg/commitdiff
network: prevent SIGPIPE on OSX
authorwm4 <nfxjfg@googlemail.com>
Sat, 30 May 2015 18:50:43 +0000 (20:50 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Sat, 30 May 2015 20:29:19 +0000 (22:29 +0200)
OSX does not know MSG_NOSIGNAL, and provides its own non-standard
mechanism instead. I guess Apple hates standards.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/network.c

index 8cc5aad6a9015cfecf727a895849269c8a8c3da6..47ade8cb62f608a3f6d01d67f85adb7896013a35 100644 (file)
@@ -180,6 +180,10 @@ 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));
+#endif
     return fd;
 }