From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1791) id B48513858C2C; Tue, 29 Nov 2022 21:20:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B48513858C2C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1669756855; bh=ulOCMrdH78bj+TF/ONVRE/8IAhDCXhG7t8GJBpBkjTg=; h=From:To:Subject:Date:From; b=Usb4jHCcNDBNOdcYkJP7CI9YSSPPMH2zPzCmMM5/pP4b8zv8jGzZe0lNr5cKqqpif N2xEgeTcmvj1Gus440Z9t0XWsVHRZE2B625USLo7rYtqLFEfda6M8gjcGkW9Lipix0 5yqQXvKP5on2370fG7EHNdZfK2UlQibQPcxDmqLE= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Adhemerval Zanella To: glibc-cvs@sourceware.org Subject: [glibc/azanella/posix_spawn-clone3] linux: Do not reset signal handler in posix_spawn if it is already SIG_DFL X-Act-Checkin: glibc X-Git-Author: Adhemerval Zanella X-Git-Refname: refs/heads/azanella/posix_spawn-clone3 X-Git-Oldrev: 885d340f20aab989482b8a1f844a224a1656d52c X-Git-Newrev: f337a4430947ff13a36859220d86e671e90d6444 Message-Id: <20221129212055.B48513858C2C@sourceware.org> Date: Tue, 29 Nov 2022 21:20:55 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=f337a4430947ff13a36859220d86e671e90d6444 commit f337a4430947ff13a36859220d86e671e90d6444 Author: Adhemerval Zanella Date: Wed Sep 28 17:26:42 2022 -0300 linux: Do not reset signal handler in posix_spawn if it is already SIG_DFL There is no need to issue another sigaction is the disposition is already SIG_DFL. Checked on x86_64-linux-gnu. Diff: --- 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; }