Another pipe-related problem?

Takashi Yano takashi.yano@nifty.ne.jp
Tue Nov 9 23:22:45 GMT 2021


On Tue, 9 Nov 2021 09:11:28 -0500
Ken Brown wrote:
> I'll have to reproduce the hang myself in order to test this (or maybe you could 
> test it), but I now have a new guess: If the read call above keeps failing with 
> EINTR, then we're in an infinite loop.  This could happen because of the 
> following code in fhandler_pipe::raw_read:
> 
>    DWORD waitret = cygwait (read_mtx, timeout);
>    switch (waitret)
>      {
>      case WAIT_OBJECT_0:
>        break;
>      case WAIT_TIMEOUT:
>        set_errno (EAGAIN);
>        len = (size_t) -1;
>        return;
>      default:
>        set_errno (EINTR);
>        len = (size_t) -1;
>        return;
>      }
> 
> Takashi, is EINTR really the appropriate errno in the default case?  Isn't 
> cygwait supposed to handle signals?

I assume cygwait() returns WAIT_SIGNALED when signalled
by SIGINT, SIGTERM, SIGTSTP, etc...  In this case, EINTR
should return I think.

Is it wrong?

-- 
Takashi Yano <takashi.yano@nifty.ne.jp>


More information about the Cygwin mailing list