summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rw-r--r--bin/sh/eval.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/bin/sh/eval.c b/bin/sh/eval.c
index eeea605..c0b2096 100644
--- a/bin/sh/eval.c
+++ b/bin/sh/eval.c
@@ -401,8 +401,8 @@ evalsubshell(union node *n, int flags)
int backgnd = (n->type == NBACKGND);
expredir(n->nredir.redirect);
- jp = makejob(n, 1);
- if (forkshell(jp, n, backgnd) == 0) {
+ if ((!backgnd && flags & EV_EXIT && !have_traps()) ||
+ forkshell(jp = makejob(n, 1), n, backgnd) == 0) {
if (backgnd)
flags &=~ EV_TESTED;
redirect(n->nredir.redirect, 0);
OpenPOWER on IntegriCloud