* fhandler_serial.cc (fhandler_serial::raw_read): Always find number of bytes

ready to be read whether overlapped_armed or not.
This commit is contained in:
Christopher Faylor
2000-12-20 05:57:59 +00:00
parent b92b863bbf
commit 2bfdcd8a5f
3 changed files with 16 additions and 10 deletions

View File

@ -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))
{