diff options
author | Ken Brown <kbrown@cornell.edu> | 2019-05-09 10:47:47 -0400 |
---|---|---|
committer | Ken Brown <kbrown@cornell.edu> | 2019-05-09 14:41:28 -0400 |
commit | 1372021a2dc380946f9d8b549315975205132413 (patch) | |
tree | 7e3a2b7a7a851cc54e0ed3329677f341c72e93c2 | |
parent | 674b4fe995d28a140cd2f1fec856d27b53ea62a9 (diff) | |
download | cygnal-1372021a2dc380946f9d8b549315975205132413.tar.gz cygnal-1372021a2dc380946f9d8b549315975205132413.tar.bz2 cygnal-1372021a2dc380946f9d8b549315975205132413.zip |
Cygwin: FIFO: remove incorrect duplexer code
raw_read had some code that was based on an incorrect implementation
of duplexers.
-rw-r--r-- | winsup/cygwin/fhandler_fifo.cc | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/winsup/cygwin/fhandler_fifo.cc b/winsup/cygwin/fhandler_fifo.cc index a1e395bf6..dd59eb6e0 100644 --- a/winsup/cygwin/fhandler_fifo.cc +++ b/winsup/cygwin/fhandler_fifo.cc @@ -780,21 +780,14 @@ fhandler_fifo::raw_read (void *in_ptr, size_t& len) fifo_client_unlock (); return; } - /* If the pipe is empty, we usually get nread == -1 with - ERROR_NO_DATA or ERROR_PIPE_LISTENING. An exception is - that in the duplex case we may get nread == 0 when we - attempt to read from the duplex pipe (fc_handler[0]). */ - else if (nread < 0) - switch (GetLastError ()) - { - case ERROR_NO_DATA: - case ERROR_PIPE_LISTENING: - break; - default: - fifo_client_unlock (); - goto errout; - } - else if (nread == 0 && (!duplexer || i > 0)) + /* If the pipe is empty, we get nread == -1 with + ERROR_NO_DATA. */ + else if (nread < 0 && GetLastError () != ERROR_NO_DATA) + { + fifo_client_unlock (); + goto errout; + } + else if (nread == 0) /* Client has disconnected. */ { fc_handler[i].state = fc_invalid; |