Source-Changes-HG archive

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

[src/trunk]: src/bin/sh It is not only the EXIT trap we need to check for whe...



details:   https://anonhg.NetBSD.org/src/rev/cf4f4b1b6b94
branches:  trunk
changeset: 446333:cf4f4b1b6b94
user:      kre <kre%NetBSD.org@localhost>
date:      Fri Nov 30 23:22:45 2018 +0000

description:
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

diffstat:

 bin/sh/eval.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r b3c9f98abbb5 -r cf4f4b1b6b94 bin/sh/eval.c
--- a/bin/sh/eval.c     Fri Nov 30 20:53:02 2018 +0000
+++ b/bin/sh/eval.c     Fri Nov 30 23:22:45 2018 +0000
@@ -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 @@
        }
 
        /* 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 &&



Home | Main Index | Thread Index | Old Index