From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 7868) id 831F73857820; Wed, 10 Nov 2021 12:40:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 831F73857820 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: Handle WAIT_CANCELED when waiting read_mtx. X-Act-Checkin: newlib-cygwin X-Git-Author: Takashi Yano X-Git-Refname: refs/heads/master X-Git-Oldrev: 328e1b1a3d2df7721483c2d4c4b1f0ca197ce74c X-Git-Newrev: c6f0a46d715d46a0716a505d728ff08e7c5b156a Message-Id: <20211110124003.831F73857820@sourceware.org> Date: Wed, 10 Nov 2021 12:40:03 +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: Wed, 10 Nov 2021 12:40:03 -0000 https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=c6f0a46d715d46a0716a505d728ff08e7c5b156a commit c6f0a46d715d46a0716a505d728ff08e7c5b156a Author: Takashi Yano Date: Wed Nov 10 12:24:53 2021 +0900 Cygwin: pipe: Handle WAIT_CANCELED when waiting read_mtx. - Add missing handling for WAIT_CANCELED in cygwait() for read_mtx in raw_read(). Diff: --- winsup/cygwin/fhandler_pipe.cc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/winsup/cygwin/fhandler_pipe.cc b/winsup/cygwin/fhandler_pipe.cc index bc06d157c..13731437e 100644 --- a/winsup/cygwin/fhandler_pipe.cc +++ b/winsup/cygwin/fhandler_pipe.cc @@ -302,10 +302,18 @@ fhandler_pipe::raw_read (void *ptr, size_t& len) set_errno (EAGAIN); len = (size_t) -1; return; - default: + case WAIT_SIGNALED: set_errno (EINTR); len = (size_t) -1; return; + case WAIT_CANCELED: + pthread::static_cancel_self (); + /* NOTREACHED */ + default: + /* Should not reach here. */ + __seterrno (); + len = (size_t) -1; + return; } while (nbytes < len) {