From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 7868) id 9D6A43858419; Mon, 13 Dec 2021 10:40:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9D6A43858419 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Takashi Yano To: cygwin-cvs@sourceware.org Subject: [newlib-cygwin] Cygwin: pipe: Restore blocking mode for cygwin process at startup. X-Act-Checkin: newlib-cygwin X-Git-Author: Takashi Yano X-Git-Refname: refs/heads/master X-Git-Oldrev: 451bbfb9f3313b9645f19e9df62e2c508f701759 X-Git-Newrev: 90788821b7d8f48e7f5e31fed68e54856a97b577 Message-Id: <20211213104016.9D6A43858419@sourceware.org> Date: Mon, 13 Dec 2021 10:40:16 +0000 (GMT) X-BeenThere: cygwin-cvs@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Cygwin core component git logs List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Dec 2021 10:40:16 -0000 https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=90788821b7d8f48e7f5e31fed68e54856a97b577 commit 90788821b7d8f48e7f5e31fed68e54856a97b577 Author: Takashi Yano Date: Wed Nov 17 17:08:05 2021 +0900 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. Diff: --- 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))