osdep/subprocess-posix: restore signal mask on detached fork failure
This commit is contained in:
1 parent
f232963c61
commit
1ad719ff19
1 file changed
+3
-1
@@ -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();
|
||||
|
||||
Reference in new issue
Block a user