about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAdhemerval Zanella Netto <adhemerval.zanella@linaro.org>2023-01-12 10:58:48 -0300
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2023-02-01 08:42:11 -0300
commitff9ffc805f5859f9f1fe3a006967b4cf7b191bb2 (patch)
tree71d49570c0f8c0fa96456da449ae6b59e8985950
parent2412deae1af0ca37b096ff73517486e7d1e9fe46 (diff)
downloadglibc-ff9ffc805f5859f9f1fe3a006967b4cf7b191bb2.tar.gz
glibc-ff9ffc805f5859f9f1fe3a006967b4cf7b191bb2.tar.xz
glibc-ff9ffc805f5859f9f1fe3a006967b4cf7b191bb2.zip
linux: Do not reset signal handler in posix_spawn if it is already SIG_DFL
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>
-rw-r--r--sysdeps/unix/sysv/linux/spawni.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sysdeps/unix/sysv/linux/spawni.c b/sysdeps/unix/sysv/linux/spawni.c
index b7a6fe320d..a1a14a58ae 100644
--- a/sysdeps/unix/sysv/linux/spawni.c
+++ b/sysdeps/unix/sysv/linux/spawni.c
@@ -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;
 	    }