[PATCH v2 01/11] linux: Do not reset signal handler in posix_spawn if it is already SIG_DFL

Carlos O'Donell carlos@redhat.com
Wed Jan 11 21:27:01 GMT 2023


On 11/4/22 15:01, Adhemerval Zanella via Libc-alpha wrote:
> There is no need to issue another sigaction is the disposition is
> already SIG_DFL.
> 
> Checked on x86_64-linux-gnu.

Changes requested per original v2. See other review. Please post v4.

> ---
>  sysdeps/unix/sysv/linux/spawni.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/sysdeps/unix/sysv/linux/spawni.c b/sysdeps/unix/sysv/linux/spawni.c
> index ee843a2247..65ee03c804 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;
>  	    }

-- 
Cheers,
Carlos.



More information about the Libc-alpha mailing list