Source-Changes-HG archive

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

[src/trunk]: src/bin/sh only for when trap if we are going to exit.



details:   https://anonhg.NetBSD.org/src/rev/eb2225f527e4
branches:  trunk
changeset: 747976:eb2225f527e4
user:      christos <christos%NetBSD.org@localhost>
date:      Wed Oct 07 18:12:11 2009 +0000

description:
only for when trap if we are going to exit.

diffstat:

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

diffs (27 lines):

diff -r 80c0d088a476 -r eb2225f527e4 bin/sh/eval.c
--- a/bin/sh/eval.c     Wed Oct 07 16:40:30 2009 +0000
+++ b/bin/sh/eval.c     Wed Oct 07 18:12:11 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: eval.c,v 1.97 2009/10/06 20:05:10 christos Exp $       */
+/*     $NetBSD: eval.c,v 1.98 2009/10/07 18:12:11 christos 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.97 2009/10/06 20:05:10 christos Exp $");
+__RCSID("$NetBSD: eval.c,v 1.98 2009/10/07 18:12:11 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -821,7 +821,7 @@
        }
 
        /* Fork off a child process if necessary. */
-       if (cmd->ncmd.backgnd || trap[0]
+       if (cmd->ncmd.backgnd || (trap[0] && (flags & EV_EXIT) != 0)
         || (cmdentry.cmdtype == CMDNORMAL && (flags & EV_EXIT) == 0)
         || ((flags & EV_BACKCMD) != 0
            && ((cmdentry.cmdtype != CMDBUILTIN && cmdentry.cmdtype != CMDSPLBLTIN)



Home | Main Index | Thread Index | Old Index