about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/process/posix_spawn.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/process/posix_spawn.c b/src/process/posix_spawn.c
index e718cee3..7018c37e 100644
--- a/src/process/posix_spawn.c
+++ b/src/process/posix_spawn.c
@@ -31,7 +31,9 @@ int __posix_spawnx(pid_t *res, const char *path,
 	for (i=1; i<=64; i++) {
 		struct sigaction sa;
 		sigaction(i, 0, &sa);
-		if (sa.sa_handler!=SIG_IGN || sigismember(&attr->__def, i)) {
+		if (sa.sa_handler!=SIG_IGN ||
+		    ((attr->__flags & POSIX_SPAWN_SETSIGDEF)
+		     && sigismember(&attr->__def, i) )) {
 			sa.sa_handler = SIG_DFL;
 			sigaction(i, &sa, 0);
 		}