public inbox for cygwin-cvs@sourceware.org
help / color / mirror / Atom feed
* [newlib-cygwin] Cygwin: FIFO: remove incorrect duplexer code
@ 2019-05-09 18:52 Ken Brown
0 siblings, 0 replies; only message in thread
From: Ken Brown @ 2019-05-09 18:52 UTC (permalink / raw)
To: cygwin-cvs
https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=1372021a2dc380946f9d8b549315975205132413
commit 1372021a2dc380946f9d8b549315975205132413
Author: Ken Brown <kbrown@cornell.edu>
Date: Thu May 9 10:47:47 2019 -0400
Cygwin: FIFO: remove incorrect duplexer code
raw_read had some code that was based on an incorrect implementation
of duplexers.
Diff:
---
winsup/cygwin/fhandler_fifo.cc | 23 ++++++++---------------
1 file changed, 8 insertions(+), 15 deletions(-)
diff --git a/winsup/cygwin/fhandler_fifo.cc b/winsup/cygwin/fhandler_fifo.cc
index a1e395b..dd59eb6 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;
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2019-05-09 18:52 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-09 18:52 [newlib-cygwin] Cygwin: FIFO: remove incorrect duplexer code Ken Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).