[FFmpeg-cvslog] network: prevent SIGPIPE on OSX
wm4
git at videolan.org
Sun May 31 12:00:17 CEST 2015
ffmpeg | branch: master | wm4 <nfxjfg at googlemail.com> | Thu May 28 18:23:27 2015 +0200| [881b80b3294483696a21b21a69fa5eee30f33037] | committer: Martin Storsjö
network: prevent SIGPIPE on OSX
OSX does not know MSG_NOSIGNAL. BSD (which OSX is based on) has got
the socket option SO_NOSIGPIPE (even if modern BSDs also support
MSG_NOSIGNAL).
Signed-off-by: Martin Storsjö <martin at martin.st>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=881b80b3294483696a21b21a69fa5eee30f33037
---
libavformat/network.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/libavformat/network.c b/libavformat/network.c
index a12e70d..2c34b4a 100644
--- a/libavformat/network.c
+++ b/libavformat/network.c
@@ -153,6 +153,10 @@ int ff_socket(int af, int type, int proto)
fcntl(fd, F_SETFD, FD_CLOEXEC);
#endif
}
+#ifdef SO_NOSIGPIPE
+ if (fd != -1)
+ setsockopt(fd, SOL_SOCKET, SO_NOSIGPIPE, &(int){1}, sizeof(int));
+#endif
return fd;
}
More information about the ffmpeg-cvslog
mailing list