summaryrefslogtreecommitdiff
path: root/Src/signals.c
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2002-05-29 14:28:05 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2002-05-29 14:28:05 +0000
commit1ca8378051227d70700d9f754d22e1bbde2924ad (patch)
tree8a350896e4ba41a9282fc6ebe84f9619f1dd0212 /Src/signals.c
parent7898d5b1989c88e67f349ecfc088d86429932979 (diff)
downloadzsh-1ca8378051227d70700d9f754d22e1bbde2924ad.tar.gz
zsh-1ca8378051227d70700d9f754d22e1bbde2924ad.zip
17250: dont't execsave()/execrestore() around synchronous traps
Diffstat (limited to 'Src/signals.c')
-rw-r--r--Src/signals.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/Src/signals.c b/Src/signals.c
index fc8705f4f..8b1b9775c 100644
--- a/Src/signals.c
+++ b/Src/signals.c
@@ -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) {