mirror of
git://git.code.sf.net/p/zsh/code
synced 2024-11-19 13:33:52 +01:00
17250: dont't execsave()/execrestore() around synchronous traps
This commit is contained in:
parent
7898d5b198
commit
1ca8378051
@ -1,5 +1,9 @@
|
||||
2002-05-29 Peter Stephenson <pws@csr.com>
|
||||
|
||||
* 17250: Src/signals.c: don't execsave()/execrestore() around
|
||||
traps which are executed synchronously, which caused unexpected
|
||||
return statuses from `trap "return ..." EXIT'.
|
||||
|
||||
* 17249: Src/Modules/tcp.c: send output from `ztcp' or `ztcp -v'
|
||||
to stdout, not the zle file descriptor.
|
||||
|
||||
|
@ -945,7 +945,16 @@ dotrapargs(int sig, int *sigtr, void *sigfn)
|
||||
*sigtr |= ZSIG_IGNORED;
|
||||
|
||||
lexsave();
|
||||
execsave();
|
||||
if (sig != SIGEXIT && sig != SIGDEBUG) {
|
||||
/*
|
||||
* SIGEXIT and SIGDEBUG are always run synchronously, so we don't
|
||||
* need to save and restore the state.
|
||||
*
|
||||
* Do we actually need this at all now we queue signals
|
||||
* for handling in places where they won't cause trouble?
|
||||
*/
|
||||
execsave();
|
||||
}
|
||||
breaks = 0;
|
||||
runhookdef(BEFORETRAPHOOK, NULL);
|
||||
if (*sigtr & ZSIG_FUNC) {
|
||||
@ -972,7 +981,8 @@ dotrapargs(int sig, int *sigtr, void *sigfn)
|
||||
trapret = trapreturn;
|
||||
else if (errflag)
|
||||
trapret = 1;
|
||||
execrestore();
|
||||
if (sig != SIGEXIT && sig != SIGDEBUG)
|
||||
execrestore();
|
||||
lexrestore();
|
||||
|
||||
if (trapret > 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user