Skip to content

Commit

Permalink
overcome a possible race in sicprocmask seen since version 1.43.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
SilvanScherrer committed Feb 23, 2023
1 parent 11e98e4 commit 4108e75
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/unix/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -826,8 +826,10 @@ static int uv__spawn_and_init_child_fork(const uv_process_options_t* options,
sigdelset(&signewset, SIGILL);
sigdelset(&signewset, SIGSYS);
sigdelset(&signewset, SIGABRT);
#ifndef __OS2__
if (pthread_sigmask(SIG_BLOCK, &signewset, &sigoldset) != 0)
abort();
#endif

*pid = fork();

Expand All @@ -837,8 +839,10 @@ static int uv__spawn_and_init_child_fork(const uv_process_options_t* options,
abort();
}

#ifndef __OS2__
if (pthread_sigmask(SIG_SETMASK, &sigoldset, NULL) != 0)
abort();
#endif

if (*pid == -1)
/* Failed to fork */
Expand Down

0 comments on commit 4108e75

Please sign in to comment.