public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc] posix: Ensure the initial signal disposition for tst-spawn7
@ 2023-03-08 13:09 Adhemerval Zanella
  0 siblings, 0 replies; only message in thread
From: Adhemerval Zanella @ 2023-03-08 13:09 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=65387e48097077c71ed527457c59ba59f3a1f3ee

commit 65387e48097077c71ed527457c59ba59f3a1f3ee
Author: Adhemerval Zanella Netto <adhemerval.zanella@linaro.org>
Date:   Tue Mar 7 13:31:52 2023 -0300

    posix: Ensure the initial signal disposition for tst-spawn7
    
    To avoid possible failure if any parent set any initial signal
    disposition as SIG_IGN (for instance if the testcase is issued
    with nohup).
    
    Checked on x86_64-linux-gnu.
    Tested-by: Florian Weimer <fweimer@redhat.com>
    Reviewed-by: Florian Weimer <fweimer@redhat.com>

Diff:
---
 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);

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-03-08 13:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-08 13:09 [glibc] posix: Ensure the initial signal disposition for tst-spawn7 Adhemerval Zanella

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).