summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGlenn Strauss <gstrauss@gluelogic.com>2023-05-11 15:45:31 -0400
committerGlenn Strauss <gstrauss@gluelogic.com>2023-05-11 19:00:03 -0400
commit5ce791cd57c80a8e09c5640e2886c4db4126d05f (patch)
tree9ada4a0c5a35b0f5a4a612345bd27b1afd36ed84
parent42314fdc027b664818a7b8a2acbbd3a6774c84ad (diff)
downloadlighttpd-git-5ce791cd57c80a8e09c5640e2886c4db4126d05f.tar.gz
[core] fix new use of posix_spawn with some glibc (fixes #3201)
(thx fstelzer) adjust optimization to fix use of posix_spawn() with some glibc vers, as older versions rejected sigaction() SIG_DFL on some signals including SIGKILL, SIGSTOP, and bits in signal mask set higher than NSIG x-ref: "include_shell not working on all platforms" https://redmine.lighttpd.net/issues/3201
-rw-r--r--src/fdevent.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/fdevent.c b/src/fdevent.c
index e4084bad..7686047f 100644
--- a/src/fdevent.c
+++ b/src/fdevent.c
@@ -516,12 +516,12 @@ 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
+ #if defined(__GLIBC__) \
+ && (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 24 && __GLIBC_MINOR__ <= 37)
+ /* glibc 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.) */
+ * Therefore, resetting all signals results in about 1/2 the syscalls.*/
&& 0 == (rc = sigfillset(&sigs))
#else
/*(force reset signals to SIG_DFL if server.c set to SIG_IGN)*/