diff options
author | herbert <herbert@gondor.apana.org.au> | 2005-02-25 22:51:38 +1100 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2005-09-26 18:33:03 +1000 |
commit | f0796f742df8c36ba50eeb877b603d694f629bef (patch) | |
tree | 63a5376fae4a25b89004bf363aeaa120afb525ec | |
parent | Do not clobber exit status on EXEVAL. (diff) | |
download | dash-f0796f742df8c36ba50eeb877b603d694f629bef.tar.gz dash-f0796f742df8c36ba50eeb877b603d694f629bef.zip |
Only reread exitstatus on EXEXIT in exitshell.
-rw-r--r-- | ChangeLog | 1 | ||||
-rw-r--r-- | src/trap.c | 7 |
2 files changed, 5 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog index f26353d..3febddd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -7,6 +7,7 @@ * Changed boolean rootshell into shlvl counter. * Catch set -e exits within built-in commands. * Size optimisations with state/s in main(). + * Only reread exitstatus on EXEXIT in exitshell. 2005-01-31 Gerrit Pape <pape@smarden.org> 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; |