process: reset the signal mask if the fork fails (#3537)
Fix a regression that sneaked into posix spawn changes. Refs: https://github.com/libuv/libuv/pull/3257
This commit is contained in:
parent
08fe5aabff
commit
bc9cd56345
@ -812,11 +812,6 @@ static int uv__spawn_and_init_child_fork(const uv_process_options_t* options,
|
||||
|
||||
*pid = fork();
|
||||
|
||||
if (*pid == -1) {
|
||||
/* Failed to fork */
|
||||
return UV__ERR(errno);
|
||||
}
|
||||
|
||||
if (*pid == 0) {
|
||||
/* Fork succeeded, in the child process */
|
||||
uv__process_child_init(options, stdio_count, pipes, error_fd);
|
||||
@ -826,6 +821,10 @@ static int uv__spawn_and_init_child_fork(const uv_process_options_t* options,
|
||||
if (pthread_sigmask(SIG_SETMASK, &sigoldset, NULL) != 0)
|
||||
abort();
|
||||
|
||||
if (*pid == -1)
|
||||
/* Failed to fork */
|
||||
return UV__ERR(errno);
|
||||
|
||||
/* Fork succeeded, in the parent process */
|
||||
return 0;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user