diff options
author | wm4 <nfxjfg@googlemail.com> | 2015-05-30 20:50:43 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-05-30 22:29:19 +0200 |
commit | c41e0aedf5fc2a92502bc400010e64b8fea89d4e (patch) | |
tree | d7f5fb09085fc39b9991f9bd65cd42b2388de35a /libavformat/network.c | |
parent | e9d646f44c6a3208e35a055ba2154f25ba497fa2 (diff) | |
download | ffmpeg-c41e0aedf5fc2a92502bc400010e64b8fea89d4e.tar.gz |
network: prevent SIGPIPE on OSX
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>
Diffstat (limited to 'libavformat/network.c')
-rw-r--r-- | libavformat/network.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libavformat/network.c b/libavformat/network.c index 8cc5aad6a9..47ade8cb62 100644 --- a/libavformat/network.c +++ b/libavformat/network.c @@ -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; } |