Module Name:    src
Committed By:   hgutch
Date:           Tue May  9 15:43:39 UTC 2023

Modified Files:
        src/usr.bin/script: script.c

Log Message:
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.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/usr.bin/script/script.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/script/script.c
diff -u src/usr.bin/script/script.c:1.33 src/usr.bin/script/script.c:1.34
--- src/usr.bin/script/script.c:1.33	Sun Feb 13 19:40:14 2022
+++ src/usr.bin/script/script.c	Tue May  9 15:43:39 2023
@@ -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 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 19
 #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");

Reply via email to