From: Collin Funk Date: Wed, 29 Oct 2025 07:08:56 +0000 (-0700) Subject: posix_spawn: Don't give sigismember an invalid signal number. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f0b32e7445a8f246726ae0593e48921272bb2481;p=thirdparty%2Fgnulib.git posix_spawn: Don't give sigismember an invalid signal number. This caused the child process to exit with a 127 exit status on OpenBSD and Solaris. * lib/spawni.c (__spawni): Use < instead of <= when comparing the signal number to NSIG. --- diff --git a/ChangeLog b/ChangeLog index b475160780..1a0994fda2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2025-10-29 Collin Funk + + posix_spawn: Don't give sigismember an invalid signal number. + This caused the child process to exit with a 127 exit status on OpenBSD + and Solaris. + * lib/spawni.c (__spawni): Use < instead of <= when comparing the signal + number to NSIG. + 2025-10-28 Paul Eggert openat2: port O_TMPFILE check to non-GNU/Linux diff --git a/lib/spawni.c b/lib/spawni.c index 34c16445fc..a1f3f84a98 100644 --- a/lib/spawni.c +++ b/lib/spawni.c @@ -927,7 +927,7 @@ __spawni (pid_t *pid, const char *file, memset (&sa, '\0', sizeof (sa)); sa.sa_handler = SIG_DFL; - for (sig = 1; sig <= NSIG; ++sig) + for (sig = 1; sig < NSIG; ++sig) if (sigismember (&attrp->_sd, sig) != 0 && sigaction (sig, &sa, NULL) != 0) _exit (SPAWN_ERROR);