https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=7590d56e620c56a8a0d7845ae70434de2aa06c98
commit 7590d56e620c56a8a0d7845ae70434de2aa06c98 Author: Takashi Yano <[email protected]> Date: Tue Jul 1 02:49:32 2025 +0900 Cygwin: pipe: Add missing code restoring real_non_blocking_mode Fixes: 940dbeffa713 ("Cygwin: pipe: Fix unexpected blocking mode change by pipe_data_available()") Reported by: Andrew Ng <[email protected]> Signed-off-by: Takashi Yano <[email protected]> (cherry picked from commit bc95e1bef29b7b1c9be00f8cd342d303466ee350) Diff: --- winsup/cygwin/fhandler/pipe.cc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/winsup/cygwin/fhandler/pipe.cc b/winsup/cygwin/fhandler/pipe.cc index 3a0f8bfe9..2ff5dfa2f 100644 --- a/winsup/cygwin/fhandler/pipe.cc +++ b/winsup/cygwin/fhandler/pipe.cc @@ -392,7 +392,10 @@ fhandler_pipe::raw_read (void *ptr, size_t& len) status = NtReadFile (get_handle (), NULL, NULL, NULL, &io, ptr, len1, NULL, NULL); if (real_non_blocking_mode) - set_pipe_non_blocking (false); + { + set_pipe_non_blocking (false); + real_non_blocking_mode = false; + } if (isclosed ()) /* A signal handler might have closed the fd. */ { set_errno (EBADF); @@ -708,7 +711,10 @@ fhandler_pipe_fifo::raw_write (const void *ptr, size_t len) } if (real_non_blocking_mode) - ((fhandler_pipe *) this)->set_pipe_non_blocking (false); + { + ((fhandler_pipe *) this)->set_pipe_non_blocking (false); + real_non_blocking_mode = false; + } CloseHandle (evt); if (pipe_mtx) /* pipe_mtx is NULL in the fifo case */
