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>
This commit is contained in:
Adhemerval Zanella Netto 2023-01-12 10:58:48 -03:00 committed by Adhemerval Zanella
parent 2412deae1a
commit ff9ffc805f
1 changed files with 1 additions and 1 deletions

View 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;
}