From: Adhemerval Zanella Netto Date: Thu, 12 Jan 2023 13:58:48 +0000 (-0300) Subject: linux: Do not reset signal handler in posix_spawn if it is already SIG_DFL X-Git-Tag: glibc-2.38~657 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ff9ffc805f5859f9f1fe3a006967b4cf7b191bb2;p=thirdparty%2Fglibc.git 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 --- diff --git a/sysdeps/unix/sysv/linux/spawni.c b/sysdeps/unix/sysv/linux/spawni.c index b7a6fe320d8..a1a14a58ae8 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; }