From f0796f742df8c36ba50eeb877b603d694f629bef Mon Sep 17 00:00:00 2001 From: herbert Date: Fri, 25 Feb 2005 22:51:38 +1100 Subject: Only reread exitstatus on EXEXIT in exitshell. --- src/trap.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/trap.c b/src/trap.c index 7bc479b..6ccca08 100644 --- a/src/trap.c +++ b/src/trap.c @@ -352,16 +352,17 @@ exitshell(void) struct jmploc loc; char *p; int status; - int jmp; #ifdef HETIO hetio_reset_term(); #endif - jmp = setjmp(loc.loc); status = exitstatus; TRACE(("pid %d, exitshell(%d)\n", getpid(), status)); - if (jmp) + if (setjmp(loc.loc)) { + if (exception == EXEXIT) + _exit(exitstatus); goto out; + } handler = &loc; if ((p = trap[0]) != NULL && *p != '\0') { trap[0] = NULL; -- cgit 1.4.1