diff options
author | Barton E. Schaefer <schaefer@zsh.org> | 2015-08-09 00:50:36 -0700 |
---|---|---|
committer | Barton E. Schaefer <schaefer@zsh.org> | 2015-08-09 16:13:52 -0700 |
commit | 9958684574bf8b0ecec6983cca57f3fa3dd7cd63 (patch) | |
tree | 81d83526e0bccdb20b3bee421131b7e0b889f361 /Src/parse.c | |
parent | ce12868837f0140b95ac748f9c35047b4ea4277a (diff) | |
download | zsh-9958684574bf8b0ecec6983cca57f3fa3dd7cd63.tar.gz zsh-9958684574bf8b0ecec6983cca57f3fa3dd7cd63.tar.xz zsh-9958684574bf8b0ecec6983cca57f3fa3dd7cd63.zip |
36022 fix bug that some loop constructs could not be interrupted, revise signal queueing
There are two underlying ideas here: (1) Keeping signals queued around anything that's doing memory management (including push/pop of the heap) has become crucial. (2) Anytime the shell is going to run a command, be it buitin or external, it must be both safe and necessary to process any queued signals, so that the apparent order of signal arrival and command execution is preserved.
Diffstat (limited to 'Src/parse.c')
-rw-r--r-- | Src/parse.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Src/parse.c b/Src/parse.c index 09567fde2..1a7416449 100644 --- a/Src/parse.c +++ b/Src/parse.c @@ -456,6 +456,8 @@ init_parse_status(void) void init_parse(void) { + queue_signals(); + if (ecbuf) zfree(ecbuf, eclen); ecbuf = (Wordcode) zalloc((eclen = EC_INIT_SIZE) * sizeof(wordcode)); @@ -466,6 +468,8 @@ init_parse(void) ecnfunc = 0; init_parse_status(); + + unqueue_signals(); } /* Build eprog. */ @@ -488,6 +492,8 @@ bld_eprog(int heap) Eprog ret; int l; + queue_signals(); + ecadd(WCB_END()); ret = heap ? (Eprog) zhalloc(sizeof(*ret)) : (Eprog) zalloc(sizeof(*ret)); @@ -511,6 +517,8 @@ bld_eprog(int heap) zfree(ecbuf, eclen); ecbuf = NULL; + unqueue_signals(); + return ret; } |