]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
linux: Do not reset signal handler in posix_spawn if it is already SIG_DFL
authorAdhemerval Zanella Netto <adhemerval.zanella@linaro.org>
Thu, 12 Jan 2023 13:58:48 +0000 (10:58 -0300)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Wed, 1 Feb 2023 11:42:11 +0000 (08:42 -0300)
There is no need to issue another sigaction if the disposition is
already SIG_DFL.

Checked on x86_64-linux-gnu.
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
sysdeps/unix/sysv/linux/spawni.c

index b7a6fe320d8af506f2b43b94c25b567b5778b41e..a1a14a58ae88954730446ec94c006c5c00770d3a 100644 (file)
@@ -129,7 +129,7 @@ __spawni_child (void *arguments)
          else
            {
              __libc_sigaction (sig, 0, &sa);
-             if (sa.sa_handler == SIG_IGN)
+             if (sa.sa_handler == SIG_IGN || sa.sa_handler == SIG_DFL)
                continue;
              sa.sa_handler = SIG_DFL;
            }