[newlib-cygwin/cygwin-3_6-branch] Cygwin: pty: Do not set input_available_event when applying line_edit()

Takashi Yano via Cygwin-cvs <[email protected]> Tue, 23 Jun 2026 01:14:03 +0000 (GMT)
Newsgroups gmane.os.cygwin.cvs
Message-ID <[email protected]>
https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3Dcad596e35ad=
eb1e56ba65c730b73ea9e6e0fe915

commit cad596e35adeb1e56ba65c730b73ea9e6e0fe915
Author: Takashi Yano <[email protected]>
Date:   Mon Jun 8 20:54:44 2026 +0900

    Cygwin: pty: Do not set input_available_event when applying line_edit()
   =20
    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.
   =20
    Fixes: a0b38a81b9be ("Cygwin: pty: Apply line_edit() for transferred in=
put 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: Mark Geisert <[email protected]>
    (cherry picked from commit f977d6edb4659a7ea1e341e2002f6d107e7d8013)

Diff:
---
 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 cae047a08..e5ffccede 100644
--- a/winsup/cygwin/fhandler/pty.cc
+++ b/winsup/cygwin/fhandler/pty.cc
@@ -2746,7 +2746,6 @@ fhandler_pty_master::apply_line_edit_to_transferred_i=
nput ()
       n -=3D ret;
       p +=3D ret;
     }
-  SetEvent (input_available_event);
 }
=20
 static DWORD