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
path: root/winsup
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2011-06-04 05:06:17 +0400
committerChristopher Faylor <me@cgf.cx>2011-06-04 05:06:17 +0400
commit665f9a59a412731a6262e953b7b76f93a2ce13c8 (patch)
tree2b2ded40fd3e30c6707a3b4cddbd8fba182d1f47 /winsup
parentcb353ff36f5283fae953d15e6bca338f5ca2ddc1 (diff)
* ntdll.h (FILE_PIPE_*): Define constants.
* select.cc (pipe_data_available): Detect closing state.
Diffstat (limited to 'winsup')
-rw-r--r--winsup/cygwin/ChangeLog5
-rw-r--r--winsup/cygwin/ntdll.h8
-rw-r--r--winsup/cygwin/select.cc2
3 files changed, 14 insertions, 1 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 299caf708..1272c87da 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,5 +1,10 @@
2011-06-03 Christopher Faylor <me.cygwin2011@cgf.cx>
+ * ntdll.h (FILE_PIPE_*): Define constants.
+ * select.cc (pipe_data_available): Detect closing state.
+
+2011-06-03 Christopher Faylor <me.cygwin2011@cgf.cx>
+
* pinfo.cc (_pinfo::set_ctty): Don't reset myself->{pgid,sid} if
terminal has no pgid or sid settings.
diff --git a/winsup/cygwin/ntdll.h b/winsup/cygwin/ntdll.h
index 82b6cff47..29e6412d6 100644
--- a/winsup/cygwin/ntdll.h
+++ b/winsup/cygwin/ntdll.h
@@ -800,6 +800,14 @@ typedef struct _FILE_ALL_INFORMATION {
FILE_NAME_INFORMATION NameInformation;
} FILE_ALL_INFORMATION, *PFILE_ALL_INFORMATION;
+enum
+{
+ FILE_PIPE_DISCONNECTED_STATE = 1,
+ FILE_PIPE_LISTENING_STATE = 2,
+ FILE_PIPE_CONNECTED_STATE = 3,
+ FILE_PIPE_CLOSING_STATE = 4
+};
+
typedef struct _FILE_PIPE_LOCAL_INFORMATION
{
ULONG NamedPipeType;
diff --git a/winsup/cygwin/select.cc b/winsup/cygwin/select.cc
index 7197ed117..6a827f70d 100644
--- a/winsup/cygwin/select.cc
+++ b/winsup/cygwin/select.cc
@@ -524,7 +524,7 @@ pipe_data_available (int fd, fhandler_base *fh, HANDLE h, bool writing)
res = true;
}
}
- return res;
+ return res ?: -!!(fpli.NamedPipeState & FILE_PIPE_CLOSING_STATE);
}
static int