From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2210) id 6BE6C3857C7F; Sun, 4 Oct 2020 16:54:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6BE6C3857C7F Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Ken Brown To: cygwin-cvs@sourceware.org Subject: [newlib-cygwin] Cygwin: AF_UNIX: listen_pipe: check for STATUS_SUCCESS X-Act-Checkin: newlib-cygwin X-Git-Author: Ken Brown X-Git-Refname: refs/heads/master X-Git-Oldrev: 5930dca459bb34aad658dffc18203e05c179edc0 X-Git-Newrev: 6748c6ecf86947964a358f53e3a6c0b63849cf33 Message-Id: <20201004165427.6BE6C3857C7F@sourceware.org> Date: Sun, 4 Oct 2020 16:54:27 +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: Sun, 04 Oct 2020 16:54:27 -0000 https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=6748c6ecf86947964a358f53e3a6c0b63849cf33 commit 6748c6ecf86947964a358f53e3a6c0b63849cf33 Author: Ken Brown Date: Sat Oct 3 12:37:36 2020 -0400 Cygwin: AF_UNIX: listen_pipe: check for STATUS_SUCCESS A successful connection can be indicated by STATUS_SUCCESS or STATUS_PIPE_CONNECTED. Previously we were checking only for the latter. Diff: --- winsup/cygwin/fhandler_socket_unix.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/winsup/cygwin/fhandler_socket_unix.cc b/winsup/cygwin/fhandler_socket_unix.cc index 0ae7fe125..1a9532fe5 100644 --- a/winsup/cygwin/fhandler_socket_unix.cc +++ b/winsup/cygwin/fhandler_socket_unix.cc @@ -1064,6 +1064,7 @@ fhandler_socket_unix::listen_pipe () IO_STATUS_BLOCK io; HANDLE evt = NULL; DWORD waitret = WAIT_OBJECT_0; + int ret = -1; io.Status = STATUS_PENDING; if (!is_nonblocking () && !(evt = create_event ())) @@ -1085,9 +1086,11 @@ fhandler_socket_unix::listen_pipe () set_errno (EINTR); else if (status == STATUS_PIPE_LISTENING) set_errno (EAGAIN); - else if (status != STATUS_PIPE_CONNECTED) + else if (status == STATUS_SUCCESS || status == STATUS_PIPE_CONNECTED) + ret = 0; + else __seterrno_from_nt_status (status); - return (status == STATUS_PIPE_CONNECTED) ? 0 : -1; + return ret; } ULONG