[vlc-commits] decomp: block SIGPIPE on the writer thread

Rémi Denis-Courmont git at videolan.org
Tue May 19 22:30:16 CEST 2015


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Tue May 19 23:27:17 2015 +0300| [eb37a5b7203ab54bc93006b901647c9bc67cc288] | committer: Rémi Denis-Courmont

decomp: block SIGPIPE on the writer thread

If the decompression process exits unexpectedly (or otherwise closes
the read end of the pipe), we want EPIPE, not SIGPIPE.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=eb37a5b7203ab54bc93006b901647c9bc67cc288
---

 modules/stream_filter/decomp.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/modules/stream_filter/decomp.c b/modules/stream_filter/decomp.c
index a648cb4..71f8758 100644
--- a/modules/stream_filter/decomp.c
+++ b/modules/stream_filter/decomp.c
@@ -111,6 +111,11 @@ static void *Thread (void *data)
 #endif
     int fd = p_sys->write_fd;
     bool error = false;
+    sigset_t set;
+
+    sigemptyset(&set);
+    sigaddset(&set, SIGPIPE);
+    pthread_sigmask(SIG_BLOCK, &set, NULL);
 
     do
     {



More information about the vlc-commits mailing list