[PATCH v2 5/6] Cygwin: AF_UNIX: listen_pipe: check for STATUS_SUCCESS

Ken Brown kbrown@cornell.edu
Tue Oct 13 13:18:28 GMT 2020

On 10/13/2020 7:28 AM, Corinna Vinschen wrote:
> On Oct  4 12:49, Ken Brown via Cygwin-patches wrote:
>> A successful connection can be indicated by STATUS_SUCCESS or
> THanks for catching but... huh?  How does Windows generate two different
> status codes for the same result from the same function?

I think (but I'd have to recheck) that if the pipe is already connected when 
NtFsControlFile is called, then the latter returns STATUS_PIPE_CONNECTED.  But 
if you first get STATUS_PENDING and then set status = io.Status after 
completion, then the result is STATUS_SUCCESS.

I might not have that exactly right.  All I remember for sure is that I was 
debugging a listen_pipe failure, and it turned out to be due to STATUS_SUCCESS 
being treated as an error condition.


More information about the Cygwin-patches mailing list