summaryrefslogtreecommitdiff
path: root/Src/builtin.c
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2000-11-11 19:50:27 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2000-11-11 19:50:27 +0000
commitc292a3ae50bd0605b015f80266418e391c3c10fe (patch)
tree8f2baf5a9e1cb7a9615190025d9825ed9824f952 /Src/builtin.c
parent89d480f57d59a794d8c2e04fc5270bed13b7a28a (diff)
downloadzsh-c292a3ae50bd0605b015f80266418e391c3c10fe.tar.gz
zsh-c292a3ae50bd0605b015f80266418e391c3c10fe.zip
Sven: 13108: Handle traps synchronously
pws: 13109, 13111: clear up zle display when output produced in trap.
Diffstat (limited to 'Src/builtin.c')
-rw-r--r--Src/builtin.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/Src/builtin.c b/Src/builtin.c
index afd140d3c..d1cea8393 100644
--- a/Src/builtin.c
+++ b/Src/builtin.c
@@ -3218,7 +3218,7 @@ zexit(int val, int from_signal)
checkjobs(); /* check if any jobs are running/stopped */
if (stopmsg) {
stopmsg = 2;
- LASTALLOC_RETURN;
+ return;
}
}
if (in_exit++ && from_signal)
@@ -3240,7 +3240,7 @@ zexit(int val, int from_signal)
}
}
if (sigtrapped[SIGEXIT])
- dotrap(SIGEXIT);
+ dotrap(SIGEXIT, 1);
runhookdef(EXITHOOK, NULL);
if (mypid != getpid())
_exit(val);
@@ -3486,7 +3486,7 @@ bin_read(char *name, char **args, char *ops, int func)
*bptr = readchar;
val = 1;
readchar = -1;
- } else if ((val = read(readfd, bptr, nchars)) <= 0)
+ } else if ((val = ztrapread(readfd, bptr, nchars)) <= 0)
break;
/* decrement number of characters read from number required */
@@ -3500,7 +3500,7 @@ bin_read(char *name, char **args, char *ops, int func)
if (!izle && !ops['u'] && !ops['p']) {
/* dispose of result appropriately, etc. */
if (isem)
- while (val > 0 && read(SHTTY, &d, 1) == 1 && d != '\n');
+ while (val > 0 && ztrapread(SHTTY, &d, 1) == 1 && d != '\n');
else
settyinfo(&shttyinfo);
if (haso) {
@@ -3733,6 +3733,7 @@ static int
zread(int izle, int *readchar)
{
char cc, retry = 0;
+ int ret;
if (izle) {
int c = getkeyptr(0);
@@ -3756,7 +3757,8 @@ zread(int izle, int *readchar)
}
for (;;) {
/* read a character from readfd */
- switch (read(readfd, &cc, 1)) {
+ ret = ztrapread(readfd, &cc, 1);
+ switch (ret) {
case 1:
/* return the character read */
return STOUC(cc);