diff options
author | Christopher Faylor <me@cgf.cx> | 2011-06-04 05:06:17 +0400 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2011-06-04 05:06:17 +0400 |
commit | 665f9a59a412731a6262e953b7b76f93a2ce13c8 (patch) | |
tree | 2b2ded40fd3e30c6707a3b4cddbd8fba182d1f47 /winsup | |
parent | cb353ff36f5283fae953d15e6bca338f5ca2ddc1 (diff) |
* ntdll.h (FILE_PIPE_*): Define constants.
* select.cc (pipe_data_available): Detect closing state.
Diffstat (limited to 'winsup')
-rw-r--r-- | winsup/cygwin/ChangeLog | 5 | ||||
-rw-r--r-- | winsup/cygwin/ntdll.h | 8 | ||||
-rw-r--r-- | winsup/cygwin/select.cc | 2 |
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 |