Message ID | 20220930192613.3491147-2-adhemerval.zanella@linaro.org |
---|---|
State | New |
Headers | show |
Series | Optimize posix_spawn signal setup with clone3 | expand |
On 9/30/22 15:26, Adhemerval Zanella via Libc-alpha wrote: > There is no need to issue another sigaction is the disposition is Please post v3 with corrected commit message. s/is the/if the/g > already SIG_DFL. > > Checked on x86_64-linux-gnu. > --- > 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) OK. Agreed, since we're going to set SIG_DFL and then call sigaction. > continue; > sa.sa_handler = SIG_DFL; > }
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; }