Cygwin: FIFO: don't read from pipes that are closing

Don't try to read from fifo_client_handlers that are in the fc_closing
state.  Experiments have shown that this always yields
STATUS_PIPE_BROKEN, so it just wastes a Windows system call.

Re-order the values in enum fifo_client_connect_state to reflect the
new status of fc_closing.
This commit is contained in:
Ken Brown
2020-08-03 09:35:00 -04:00
parent 289af73a89
commit 251624a352
3 changed files with 5 additions and 12 deletions

View File

@ -1276,20 +1276,13 @@ public:
#define CYGWIN_FIFO_PIPE_NAME_LEN 47
/* We view the fc_closing state as borderline between open and closed
for a writer at the other end of a fifo_client_handler.
We still attempt to read from the writer when the handler is in
this state, and we don't declare a reader to be at EOF if there's a
handler in this state. But the existence of a handler in this
state is not sufficient to unblock a reader trying to open. */
enum fifo_client_connect_state
{
fc_unknown,
fc_error,
fc_disconnected,
fc_listening,
fc_closing,
fc_listening,
fc_connected,
fc_input_avail,
};