summaryrefslogtreecommitdiffstats
path: root/input
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2016-09-15 13:13:23 +0200
committerwm4 <wm4@nowhere>2016-09-15 13:13:23 +0200
commit1b5b23b94849b18bedd458fd83741fa07d840c7b (patch)
tree0c4f82a780d4b22d57451849e6b25e97e693d474 /input
parentf1436658647aceb7ea58e595439fa6dd5c2cdb97 (diff)
downloadmpv-1b5b23b94849b18bedd458fd83741fa07d840c7b.tar.bz2
mpv-1b5b23b94849b18bedd458fd83741fa07d840c7b.tar.xz
client API: remove SIGPIPE overriding code
This workaround prevented that libmpv users could accidentally crash when the SIGPIPE signal was triggered by FFmpeg's OpenSSL/GnuTLS usage. But it also modifies the global signal handler state, so remove it now that this workaround is not required anymore.
Diffstat (limited to 'input')
-rw-r--r--input/ipc-unix.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/input/ipc-unix.c b/input/ipc-unix.c
index 0f4b7132e4..f5c8886a28 100644
--- a/input/ipc-unix.c
+++ b/input/ipc-unix.c
@@ -20,6 +20,7 @@
#include <unistd.h>
#include <poll.h>
+#include <signal.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/stat.h>
@@ -97,6 +98,11 @@ static void *client_thread(void *p)
{
pthread_detach(pthread_self());
+ // We don't use MSG_NOSIGNAL because the moldy fruit OS doesn't support it.
+ struct sigaction sa = { .sa_handler = SIG_IGN, .sa_flags = SA_RESTART };
+ sigfillset(&sa.sa_mask);
+ sigaction(SIGPIPE, &sa, NULL);
+
int rc;
struct client_arg *arg = p;