Module Name:    src
Committed By:   kre
Date:           Fri Nov 30 23:22:45 UTC 2018

Modified Files:
        src/bin/sh: eval.c

Log Message:
It is not only the EXIT trap we need to check for when deciding no
fork is required, but any trap   (dumb mistake...)

XXX - include in 48875 pullup to -8


To generate a diff of this commit:
cvs rdiff -u -r1.164 -r1.165 src/bin/sh/eval.c

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

Modified files:

Index: src/bin/sh/eval.c
diff -u src/bin/sh/eval.c:1.164 src/bin/sh/eval.c:1.165
--- src/bin/sh/eval.c:1.164	Mon Nov 26 13:47:39 2018
+++ src/bin/sh/eval.c	Fri Nov 30 23:22:45 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: eval.c,v 1.164 2018/11/26 13:47:39 kre Exp $	*/
+/*	$NetBSD: eval.c,v 1.165 2018/11/30 23:22:45 kre Exp $	*/
 
 /*-
  * Copyright (c) 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)eval.c	8.9 (Berkeley) 6/8/95";
 #else
-__RCSID("$NetBSD: eval.c,v 1.164 2018/11/26 13:47:39 kre Exp $");
+__RCSID("$NetBSD: eval.c,v 1.165 2018/11/30 23:22:45 kre Exp $");
 #endif
 #endif /* not lint */
 
@@ -1041,7 +1041,7 @@ evalcommand(union node *cmd, int flgs, s
 	}
 
 	/* Fork off a child process if necessary. */
-	if (cmd->ncmd.backgnd || (trap[0] && (flags & EV_EXIT) != 0)
+	if (cmd->ncmd.backgnd || (have_traps() && (flags & EV_EXIT) != 0)
 	 || ((cmdentry.cmdtype == CMDNORMAL || cmdentry.cmdtype == CMDUNKNOWN)
 	     && (flags & EV_EXIT) == 0)
 	 || ((flags & EV_BACKCMD) != 0 &&

Reply via email to