Skip to content

Commit

Permalink
executor: really set POSIX_SPAWN_SETSIGDEF for posix_spawn
Browse files Browse the repository at this point in the history
posix_spawnattr_setflags() doesn't OR the input to the current set of flags,
it overwrites them, so we are currently losing POSIX_SPAWN_SETSIGDEF.

Follow-up for: 6ecdfe7
  • Loading branch information
bluca committed Feb 5, 2024
1 parent 4e71714 commit 9ca13d6
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/basic/process-util.c
Original file line number Diff line number Diff line change
Expand Up @@ -2054,10 +2054,8 @@ int posix_spawn_wrapper(const char *path, char *const *argv, char *const *envp,
r = posix_spawnattr_init(&attr);
if (r != 0)
return -r; /* These functions return a positive errno on failure */
r = posix_spawnattr_setflags(&attr, POSIX_SPAWN_SETSIGMASK);
if (r != 0)
goto fail;
r = posix_spawnattr_setflags(&attr, POSIX_SPAWN_SETSIGDEF); /* Set all signals to SIG_DFL */
/* Set all signals to SIG_DFL */
r = posix_spawnattr_setflags(&attr, POSIX_SPAWN_SETSIGMASK|POSIX_SPAWN_SETSIGDEF);
if (r != 0)
goto fail;
r = posix_spawnattr_setsigmask(&attr, &mask);
Expand Down

0 comments on commit 9ca13d6

Please sign in to comment.