From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1791) id 2D2DC3858D37; Wed, 1 Feb 2023 12:19:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2D2DC3858D37 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1675253997; bh=PmC9dRGjfxnpFROp0yjpJ+6i13ugwr+NosxroU/SAaw=; h=From:To:Subject:Date:From; b=Oo92W5FMhN5A+00s3lPr8pJmQYHtvHeKOvDrZXMaZT24Ayz7BtIa5Hbf9xGEHqDsl 73Yqy68cS8tdwx7RONkGj9StY4qF6kvnqvUYIiiu9r5xVebfafuS+QBCwq2W6dpSuj lRSs5OPukGBG1dSrK+QSIgTIhC17vOukWGc96yrY= 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] linux: Do not reset signal handler in posix_spawn if it is already SIG_DFL X-Act-Checkin: glibc X-Git-Author: Adhemerval Zanella Netto X-Git-Refname: refs/heads/master X-Git-Oldrev: 2412deae1af0ca37b096ff73517486e7d1e9fe46 X-Git-Newrev: ff9ffc805f5859f9f1fe3a006967b4cf7b191bb2 Message-Id: <20230201121957.2D2DC3858D37@sourceware.org> Date: Wed, 1 Feb 2023 12:19:57 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=ff9ffc805f5859f9f1fe3a006967b4cf7b191bb2 commit ff9ffc805f5859f9f1fe3a006967b4cf7b191bb2 Author: Adhemerval Zanella Netto Date: Thu Jan 12 10:58:48 2023 -0300 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: --- 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 b7a6fe320d..a1a14a58ae 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; }