OSDN Git Service
(root)
/
android-x86
/
external-ffmpeg.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0181ae9
)
network: prevent SIGPIPE on OSX
author
wm4
<nfxjfg@googlemail.com>
Thu, 28 May 2015 16:23:27 +0000
(18:23 +0200)
committer
Martin Storsjö
<martin@martin.st>
Sun, 31 May 2015 07:10:16 +0000
(10:10 +0300)
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@martin.st>
libavformat/network.c
patch
|
blob
|
history
diff --git
a/libavformat/network.c
b/libavformat/network.c
index
a12e70d
..
2c34b4a
100644
(file)
--- 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;
}