From a6ea7ab36d73093f3de2d4ae8bdcff22ae474525 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Wed, 5 May 2010 09:49:39 +0000 Subject: 27947: some cases where we should execute EXIT traps --- Src/exec.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'Src') diff --git a/Src/exec.c b/Src/exec.c index 952d118c1..19afc4ca4 100644 --- a/Src/exec.c +++ b/Src/exec.c @@ -1299,6 +1299,12 @@ sublist_done: lineno = oldlineno; if (dont_change_job) thisjob = cj; + + if (exiting && sigtrapped[SIGEXIT]) { + dotrap(SIGEXIT); + /* Make sure this doesn't get executed again. */ + sigtrapped[SIGEXIT] = 0; + } } /* Execute a pipeline. * @@ -1631,7 +1637,7 @@ execpline2(Estate state, wordcode pcode, entersubsh(((how & Z_ASYNC) ? ESUB_ASYNC : 0) | ESUB_PGRP | ESUB_KEEPTRAP); close(synch[1]); - execcmd(state, input, pipes[1], how, 0); + execcmd(state, input, pipes[1], how, 1); _exit(lastval); } } else { -- cgit 1.4.1