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

Takashi Yano tyan0@sourceware.org
Tue Jun 23 01:14:03 GMT 2026


https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=cad596e35adeb1e56ba65c730b73ea9e6e0fe915

commit cad596e35adeb1e56ba65c730b73ea9e6e0fe915
Author: Takashi Yano <takashi.yano@nifty.ne.jp>
Date:   Mon Jun 8 20:54:44 2026 +0900

    Cygwin: pty: Do not set input_available_event when applying line_edit()
    
    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 <myoga.murase@gmail.com>
    Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
    Reviewed-by: Mark Geisert <mark@maxrnd.com>
    (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_input ()
       n -= ret;
       p += ret;
     }
-  SetEvent (input_available_event);
 }
 
 static DWORD


More information about the Cygwin-cvs mailing list