public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
To: libc-alpha@sourceware.org
Subject: [PATCH] posix: Ensure the initial signal disposition for tst-spawn7
Date: Tue,  7 Mar 2023 13:31:52 -0300	[thread overview]
Message-ID: <20230307163152.2509362-1-adhemerval.zanella@linaro.org> (raw)

To avoid possible failure if any parent set any initial signal
disposition as SIG_IGN.

Checked on x86_64-linux-gnu.
---
 posix/tst-spawn7.c | 6 ++++++
 1 file changed, 6 insertions(+)

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);
-- 
2.34.1


             reply	other threads:[~2023-03-07 16:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-07 16:31 Adhemerval Zanella [this message]
2023-03-08  9:44 ` Florian Weimer
2023-03-08 13:08   ` Adhemerval Zanella Netto

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230307163152.2509362-1-adhemerval.zanella@linaro.org \
    --to=adhemerval.zanella@linaro.org \
    --cc=libc-alpha@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).