Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Problems with trap handling?



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