summaryrefslogtreecommitdiffstats
path: root/player/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'player/main.c')
-rw-r--r--player/main.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/player/main.c b/player/main.c
index b80bc994bb..bc08310e9c 100644
--- a/player/main.c
+++ b/player/main.c
@@ -22,6 +22,7 @@
#include <assert.h>
#include <string.h>
#include <pthread.h>
+#include <signal.h>
#include "config.h"
#include "talloc.h"
@@ -489,6 +490,12 @@ int mp_initialize(struct MPContext *mpctx, char **options)
if (opts->w32_priority > 0)
SetPriorityClass(GetCurrentProcess(), opts->w32_priority);
#endif
+#ifndef _WIN32
+ // Deal with OpenSSL and GnuTLS not using MSG_NOSIGNAL.
+ struct sigaction sa = { .sa_handler = SIG_IGN, .sa_flags = SA_RESTART };
+ sigfillset(&sa.sa_mask);
+ sigaction(SIGPIPE, &sa, NULL);
+#endif
prepare_playlist(mpctx, mpctx->playlist);