Re: [PATCH] Cygwin: pty: Do not set input_available_event when applying line_edit()
Takashi Yano <[email protected]> Tue, 23 Jun 2026 10:16:01 +0900
| Newsgroups | gmane.os.cygwin.patches |
|---|---|
| Message-ID | <[email protected]> |
On Sat, 20 Jun 2026 23:45:29 -0700
Mark Geisert wrote:
> Hi Takashi,
>
> On 6/8/2026 6:34 AM, Takashi Yano wrote:
> > The commit a0b38a81b9be sets input_available_event even if the
> > transferred input is still in the readahead buffer and is not ready
> > to read. The SetEvent() is called in accept_input() via line_edit(),
> > so setting this event here is not correct. This causes the issue
> > that read() returns 0 instead of blocking until accept_input() is
> > called. This patch removes this SetEvent() call.
> >
> > Fixes: a0b38a81b9be ("Cygwin: pty: Apply line_edit() for transferred input to to_cyg")
> > Addresses: https://cygwin.com/pipermail/cygwin/2026-June/259776.html
> > Reported-by: Koichi Murase <[email protected]>
> > Signed-off-by: Takashi Yano <[email protected]>
> > Reviewed-by:
> > ---
> > winsup/cygwin/fhandler/pty.cc | 1 -
> > 1 file changed, 1 deletion(-)
> >
> > diff --git a/winsup/cygwin/fhandler/pty.cc b/winsup/cygwin/fhandler/pty.cc
> > index 80331c36d..2558fa799 100644
> > --- a/winsup/cygwin/fhandler/pty.cc
> > +++ b/winsup/cygwin/fhandler/pty.cc
> > @@ -2946,7 +2946,6 @@ fhandler_pty_master::apply_line_edit_to_transferred_input ()
> > n -= ret;
> > p += ret;
> > }
> > - SetEvent (input_available_event);
> > }
> >
> > static DWORD
>
> LGTM. OK to push.
Thanks! Pushed.
--
Takashi Yano <[email protected]>