diff options
author | Christopher Faylor <me@cgf.cx> | 2000-12-20 05:57:59 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2000-12-20 05:57:59 +0000 |
commit | 2bfdcd8a5f94fd126997796f61b56a09a96820e6 (patch) | |
tree | 4d365c16f8934a361b388ad3c32f16dba73f9c0e /winsup | |
parent | b92b863bbf9331a2b069d8fcc96686b8da3bf2eb (diff) | |
download | newlib-2bfdcd8a5f94fd126997796f61b56a09a96820e6.zip newlib-2bfdcd8a5f94fd126997796f61b56a09a96820e6.tar.gz newlib-2bfdcd8a5f94fd126997796f61b56a09a96820e6.tar.bz2 |
* 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')
-rw-r--r-- | winsup/cygwin/ChangeLog | 5 | ||||
-rw-r--r-- | winsup/cygwin/exceptions.cc | 4 | ||||
-rw-r--r-- | winsup/cygwin/fhandler_serial.cc | 17 |
3 files changed, 16 insertions, 10 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 8e0a903..f56b272 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,8 @@ +Wed Dec 20 00:57:10 2000 Christopher Faylor <cgf@cygnus.com> + + * fhandler_serial.cc (fhandler_serial::raw_read): Always find number of + bytes ready to be read whether overlapped_armed or not. + Tue Dec 19 21:39:00 2000 Corinna Vinschen <corinna@vinschen.de> * syscalls.cc (remove): New function, overriding the newlib diff --git a/winsup/cygwin/exceptions.cc b/winsup/cygwin/exceptions.cc index d30eb32..6e27f10 100644 --- a/winsup/cygwin/exceptions.cc +++ b/winsup/cygwin/exceptions.cc @@ -1072,8 +1072,8 @@ events_terminate (void) #define pid_offset (unsigned)(((_pinfo *)NULL)->pid) extern "C" { -static void __stdcall reset_signal_arrived () __attribute__ ((unused)); -static void __stdcall +static void volatile __stdcall reset_signal_arrived () __attribute__ ((unused)); +static void volatile __stdcall reset_signal_arrived () { (void) ResetEvent (signal_arrived); diff --git a/winsup/cygwin/fhandler_serial.cc b/winsup/cygwin/fhandler_serial.cc index c1e472b..838da6b 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)) { |