* ntdll.h (FILE_PIPE_*): Define constants.

* select.cc (pipe_data_available): Detect closing state.
This commit is contained in:
Christopher Faylor 2011-06-04 01:06:17 +00:00
parent cb353ff36f
commit 665f9a59a4
3 changed files with 14 additions and 1 deletions

View File

@ -1,3 +1,8 @@
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> 2011-06-03 Christopher Faylor <me.cygwin2011@cgf.cx>
* pinfo.cc (_pinfo::set_ctty): Don't reset myself->{pgid,sid} if * pinfo.cc (_pinfo::set_ctty): Don't reset myself->{pgid,sid} if

View File

@ -800,6 +800,14 @@ typedef struct _FILE_ALL_INFORMATION {
FILE_NAME_INFORMATION NameInformation; FILE_NAME_INFORMATION NameInformation;
} FILE_ALL_INFORMATION, *PFILE_ALL_INFORMATION; } 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 typedef struct _FILE_PIPE_LOCAL_INFORMATION
{ {
ULONG NamedPipeType; ULONG NamedPipeType;

View File

@ -524,7 +524,7 @@ pipe_data_available (int fd, fhandler_base *fh, HANDLE h, bool writing)
res = true; res = true;
} }
} }
return res; return res ?: -!!(fpli.NamedPipeState & FILE_PIPE_CLOSING_STATE);
} }
static int static int