From 1ad719ff19b385ade87ca8d5c0cd48df6873ef6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kacper=20Michaj=C5=82ow?= Date: Mon, 8 Jun 2026 01:20:56 +0200 Subject: [PATCH] osdep/subprocess-posix: restore signal mask on detached fork failure --- osdep/subprocess-posix.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/osdep/subprocess-posix.c b/osdep/subprocess-posix.c index d583ab07d0..3e9d15120c 100644 --- a/osdep/subprocess-posix.c +++ b/osdep/subprocess-posix.c @@ -224,8 +224,10 @@ void mp_subprocess2(struct mp_subprocess_opts *opts, sigfillset(&sigmask); pthread_sigmask(SIG_BLOCK, &sigmask, &oldmask); pid_t fres = fork(); - if (fres < 0) + if (fres < 0) { + pthread_sigmask(SIG_SETMASK, &oldmask, NULL); goto done; + } if (fres == 0) { // child setsid();