aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--posix/tst-spawn7.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/posix/tst-spawn7.c b/posix/tst-spawn7.c
index fedb09fb94..fb06915cb7 100644
--- a/posix/tst-spawn7.c
+++ b/posix/tst-spawn7.c
@@ -99,6 +99,12 @@ dummy_sa_handler (int signal)
static void
do_test_signals (void)
{
+ /* Ensure the initial signal disposition, ignore EINVAL for internal
+ signal such as SIGCANCEL. */
+ for (int sig = 1; sig < _NSIG; ++sig)
+ sigaction (sig, &(struct sigaction) { .sa_handler = SIG_DFL,
+ .sa_flags = 0 }, NULL);
+
{
/* Check if all signals handler are set to SIG_DFL on spawned process. */
spawn_signal_test ("SIG_DFL", NULL);