Module Name: src Committed By: christos Date: Wed Oct 7 18:12:11 UTC 2009
Modified Files: src/bin/sh: eval.c Log Message: only for when trap if we are going to exit. To generate a diff of this commit: cvs rdiff -u -r1.97 -r1.98 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.97 src/bin/sh/eval.c:1.98 --- src/bin/sh/eval.c:1.97 Tue Oct 6 16:05:10 2009 +++ src/bin/sh/eval.c Wed Oct 7 14:12:11 2009 @@ -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)