Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Problems with trap handling?
- X-seq: zsh-workers 9522
- From: Sven Wischnowsky <wischnow@xxxxxxxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxxxxxx
- Subject: Re: Problems with trap handling?
- Date: Wed, 2 Feb 2000 09:32:01 +0100 (MET)
- In-reply-to: Peter Stephenson's message of Tue, 01 Feb 2000 18:45:18 +0000
- Mailing-list: contact zsh-workers-help@xxxxxxxxxxxxxx; run by ezmlm
Peter Stephenson wrote:
> ...
> >
> > We could either test retflag/breaks/contflag there or give it a flag
> > that says to stop in case of EINTR and which would be set by bin_read
> > (via getquery()).
>
> I think the answer is it should be testing more flags at this point:
> whatever's making the function return (i.e. retflag) should make the read
> return, too. It's certainly correct that EINTR shouldn't make it return ---
> the problem was that the query aborted if, say, a background job exited,
> and as far as I can see the same issue applies to any call to read1char().
> It's quite possible the same issue comes up at umpteen other places in the
> code, alas.
Exactly what I'm fearing, too. Anybody know of any other
almost-endless loops in the code?
Bye
Sven
diff -ru ../z.old/Src/utils.c Src/utils.c
--- ../z.old/Src/utils.c Tue Feb 1 14:47:39 2000
+++ Src/utils.c Wed Feb 2 09:30:29 2000
@@ -1300,7 +1300,7 @@
char c;
while (read(SHTTY, &c, 1) != 1) {
- if (errno != EINTR || errflag)
+ if (errno != EINTR || errflag || retflag || breaks || contflag)
return -1;
}
return STOUC(c);
--
Sven Wischnowsky wischnow@xxxxxxxxxxxxxxxxxxxxxxx
Messages sorted by:
Reverse Date,
Date,
Thread,
Author