Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/script Reset SIGCHLD handler to SIG_DFL.



details:   https://anonhg.NetBSD.org/src/rev/9ebc0a0f4a4c
branches:  trunk
changeset: 374658:9ebc0a0f4a4c
user:      hgutch <hgutch%NetBSD.org@localhost>
date:      Tue May 09 15:43:39 2023 +0000

description:
Reset SIGCHLD handler to SIG_DFL.

If run with "-c", both child and parent script processes will handle
SIGCHLD resulting in a possible duplicate "Script done" line in the
output.  This fixes bin/54514.

diffstat:

 usr.bin/script/script.c |  5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diffs (26 lines):

diff -r 6c31c93fa5d3 -r 9ebc0a0f4a4c usr.bin/script/script.c
--- a/usr.bin/script/script.c   Tue May 09 15:37:29 2023 +0000
+++ b/usr.bin/script/script.c   Tue May 09 15:43:39 2023 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: script.c,v 1.33 2022/02/13 19:40:14 christos Exp $     */
+/*     $NetBSD: script.c,v 1.34 2023/05/09 15:43:39 hgutch Exp $       */
 
 /*
  * Copyright (c) 1980, 1992, 1993
@@ -39,7 +39,7 @@
 #if 0
 static char sccsid[] = "@(#)script.c   8.1 (Berkeley) 6/6/93";
 #endif
-__RCSID("$NetBSD: script.c,v 1.33 2022/02/13 19:40:14 christos Exp $");
+__RCSID("$NetBSD: script.c,v 1.34 2023/05/09 15:43:39 hgutch Exp $");
 #endif /* not lint */
 
 #include <sys/types.h>
@@ -192,6 +192,7 @@ main(int argc, char *argv[])
                fail();
        }
        if (child == 0) {
+               (void)xsignal(SIGCHLD, SIG_DFL);
                subchild = child = fork();
                if (child == -1) {
                        warn("fork");



Home | Main Index | Thread Index | Old Index