Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKen Brown <kbrown@cornell.edu>2021-04-01 17:56:04 +0300
committerKen Brown <kbrown@cornell.edu>2021-04-01 17:56:04 +0300
commit451ec9bb130666b94a5b597ba6eb7cc758f4e1e2 (patch)
treec26d7d347d19df8058036bbcb76f73694759bf86
parentd2fb5bc045deec354aa523a9a99389d6a7250dff (diff)
Cygwin: AF_UNIX: listen_pipe: consider STATUS_PIPE_CLOSING
NtFsControlFile(FSCTL_PIPE_LISTEN) can return STATUS_PIPE_CLOSING if a process has already connected to the pipe, written, and closed its handle. Treat this case the same as STATUS_SUCCESS. FIXME: We need to check more carefully that there isn't really an error condition.
-rw-r--r--winsup/cygwin/fhandler_socket_unix.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/winsup/cygwin/fhandler_socket_unix.cc b/winsup/cygwin/fhandler_socket_unix.cc
index d283a7ede..1a0a7e7ba 100644
--- a/winsup/cygwin/fhandler_socket_unix.cc
+++ b/winsup/cygwin/fhandler_socket_unix.cc
@@ -1142,6 +1142,14 @@ fhandler_socket_unix::listen_pipe ()
set_errno (EINTR);
else if (status == STATUS_PIPE_LISTENING)
set_errno (EAGAIN);
+ else if (status == STATUS_PIPE_CLOSING)
+ {
+ /* FIXME: For now I'm assuming that someone connected, wrote,
+ and closed. But we should probably query the os to be sure,
+ as in fhandler_fifo.cc. */
+ debug_printf ("STATUS_PIPE_CLOSING");
+ ret = 0;
+ }
else if (status == STATUS_SUCCESS || status == STATUS_PIPE_CONNECTED)
ret = 0;
else