From 90788821b7d8f48e7f5e31fed68e54856a97b577 Mon Sep 17 00:00:00 2001 From: Takashi Yano Date: Wed, 17 Nov 2021 17:08:05 +0900 Subject: [PATCH] Cygwin: pipe: Restore blocking mode for cygwin process at startup. - Set blocking mode properly at startup of cygwin process. This is needed if the cygwin process is executed from non-cygwin process. --- winsup/cygwin/dtable.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/winsup/cygwin/dtable.cc b/winsup/cygwin/dtable.cc index d57cbb355..e54db4446 100644 --- a/winsup/cygwin/dtable.cc +++ b/winsup/cygwin/dtable.cc @@ -410,6 +410,9 @@ dtable::init_std_file_from_handle (int fd, HANDLE handle) { fhandler_pipe *fhp = (fhandler_pipe *) fh; fhp->set_pipe_buf_size (); + /* Set read pipe always to nonblocking */ + fhp->set_pipe_non_blocking (fhp->get_device () == FH_PIPER ? + true : fhp->is_nonblocking ()); } if (!fh->open_setup (openflags)) -- 2.43.5