mirror of
https://github.com/mpv-player/mpv.git
synced 2025-12-27 05:10:20 +00:00
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.
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user