executor: really set POSIX_SPAWN_SETSIGDEF for posix_spawn

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: 6ecdfe7d10
This commit is contained in:
Luca Boccassi
2024-02-05 14:22:52 +00:00
committed by Luca Boccassi
parent 4e71714bca
commit 9ca13d60db

View File

@@ -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);