[newlib-cygwin] 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:27 +0000 (GMT)
Newsgroups gmane.os.cygwin.cvs
Message-ID <[email protected]>
https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3Df977d6edb46=
59a7ea1e341e2002f6d107e7d8013

commit f977d6edb4659a7ea1e341e2002f6d107e7d8013
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]>

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 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_i=
nput ()
       n -=3D ret;
       p +=3D ret;
     }
-  SetEvent (input_available_event);
 }
=20
 static DWORD