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
This commit is contained in:
kre 2018-11-30 23:22:45 +00:00
parent af8f486465
commit d02195817d
1 changed files with 3 additions and 3 deletions

View File

@ -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, struct backcmd *backcmd)
}
/* 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 &&