aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2020-03-16 10:20:16 +0100
committerCorinna Vinschen <corinna@vinschen.de>2020-03-16 10:20:16 +0100
commit7947581905637b837558ae9a2f1d35b8ab433e90 (patch)
treedcf7ca9d547064e5723a730d4d866b170ce3c372
parentb37a3388cca2df92c204ab8693b09966dca2dad4 (diff)
downloadnewlib-7947581905637b837558ae9a2f1d35b8ab433e90.zip
newlib-7947581905637b837558ae9a2f1d35b8ab433e90.tar.gz
newlib-7947581905637b837558ae9a2f1d35b8ab433e90.tar.bz2
Cygwin: serial: wait for CancelIo completion
Per https://devblogs.microsoft.com/oldnewthing/20110202-00/?p=11613 GetOverlappedResult must be called blocking, waiting for the overlapped operation to complete. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
-rw-r--r--winsup/cygwin/fhandler_serial.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/winsup/cygwin/fhandler_serial.cc b/winsup/cygwin/fhandler_serial.cc
index f92fc70..f729765 100644
--- a/winsup/cygwin/fhandler_serial.cc
+++ b/winsup/cygwin/fhandler_serial.cc
@@ -135,7 +135,7 @@ fhandler_serial::raw_read (void *ptr, size_t& ulen)
PurgeComm apparently discards in-flight bytes while CancelIo
only stops the overlapped IO routine. */
CancelIo (get_handle ());
- if (GetOverlappedResult (get_handle (), &io_status, &n, FALSE))
+ if (GetOverlappedResult (get_handle (), &io_status, &n, TRUE))
tot = n;
else if (GetLastError () != ERROR_OPERATION_ABORTED)
goto err;