diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/fdevent.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/fdevent.c b/src/fdevent.c index f9de595e..85de850a 100644 --- a/src/fdevent.c +++ b/src/fdevent.c @@ -516,6 +516,14 @@ pid_t fdevent_fork_execve(const char *name, char *argv[], char *envp[], int fdin #endif && 0 == (rc = sigemptyset(&sigs)) && 0 == (rc = posix_spawnattr_setsigmask(&attr, &sigs)) + #ifdef __linux__ + /* linux appears to walk all signals and to query and preserve some + * sigaction flags even if setting to SIG_DFL, though if specified + * in posix_spawnattr_setsigdefault(), resets to SIG_DFL without query. + * Therefore, resetting all signals results in about 1/2 the syscalls. + * (FreeBSD appears more efficient. Unverified on other platforms.) */ + && 0 == (rc = sigfillset(&sigs)) + #else /*(force reset signals to SIG_DFL if server.c set to SIG_IGN)*/ #ifdef SIGTTOU && 0 == (rc = sigaddset(&sigs, SIGTTOU)) @@ -528,6 +536,7 @@ pid_t fdevent_fork_execve(const char *name, char *argv[], char *envp[], int fdin #endif && 0 == (rc = sigaddset(&sigs, SIGPIPE)) && 0 == (rc = sigaddset(&sigs, SIGUSR1)) + #endif && 0 == (rc = posix_spawnattr_setsigdefault(&attr, &sigs))) { #if defined(HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSEFROM_NP) \ |