From c6f0a46d715d46a0716a505d728ff08e7c5b156a Mon Sep 17 00:00:00 2001 From: Takashi Yano Date: Wed, 10 Nov 2021 12:24:53 +0900 Subject: [PATCH] Cygwin: pipe: Handle WAIT_CANCELED when waiting read_mtx. - Add missing handling for WAIT_CANCELED in cygwait() for read_mtx in raw_read(). --- 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) {