Cygwin: serial: try fix o_nonblock

This commit is contained in:
Corinna Vinschen 2020-03-12 16:07:01 +01:00
parent bd22d2f91e
commit 57a80207ff
1 changed files with 10 additions and 0 deletions

View File

@ -68,6 +68,16 @@ fhandler_serial::raw_read (void *ptr, size_t& ulen)
goto err;
else if (ev)
termios_printf ("error detected %x", ev);
else if (is_nonblocking ())
{
if (!st.cbInQue)
{
tot = -1;
set_errno (EAGAIN);
goto out;
}
inq = st.cbInQue;
}
else if (st.cbInQue && !vtime_)
inq = st.cbInQue;
else if (!is_nonblocking () && !overlapped_armed)