Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2000-12-20 08:57:59 +0300
committerChristopher Faylor <me@cgf.cx>2000-12-20 08:57:59 +0300
commit2bfdcd8a5f94fd126997796f61b56a09a96820e6 (patch)
tree4d365c16f8934a361b388ad3c32f16dba73f9c0e /winsup/cygwin/fhandler_serial.cc
parentb92b863bbf9331a2b069d8fcc96686b8da3bf2eb (diff)
* fhandler_serial.cc (fhandler_serial::raw_read): Always find number of bytes
ready to be read whether overlapped_armed or not.
Diffstat (limited to 'winsup/cygwin/fhandler_serial.cc')
-rw-r--r--winsup/cygwin/fhandler_serial.cc17
1 files changed, 9 insertions, 8 deletions
diff --git a/winsup/cygwin/fhandler_serial.cc b/winsup/cygwin/fhandler_serial.cc
index c1e472bdf..838da6b9d 100644
--- a/winsup/cygwin/fhandler_serial.cc
+++ b/winsup/cygwin/fhandler_serial.cc
@@ -79,15 +79,16 @@ fhandler_serial::raw_read (void *ptr, size_t ulen)
// if vmin > ulen then things won't work right.
overlapped_armed = -1;
}
- if (!overlapped_armed)
+
+ if (!ClearCommError (get_handle (), &ev, &st))
+ goto err;
+ else if (ev)
+ termios_printf ("error detected %x", ev);
+ else if (st.cbInQue)
+ inq = st.cbInQue;
+ else if (!overlapped_armed)
{
- if (!ClearCommError (get_handle (), &ev, &st))
- goto err;
- else if (ev)
- termios_printf ("error detected %x", ev);
- else if (st.cbInQue)
- inq = st.cbInQue;
- else if ((size_t)tot >= minchars)
+ if ((size_t)tot >= minchars)
break;
else if (WaitCommEvent (get_handle (), &ev, &io_status))
{