osdep/subprocess-posix: restore signal mask on detached fork failure

This commit is contained in:
Kacper Michajłow
2026-06-09 11:52:29 +02:00
parent f232963c61
commit 1ad719ff19
+3 -1
View File
@@ -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();