public inbox for cygwin-cvs@sourceware.org
help / color / mirror / Atom feed
* [newlib-cygwin] Cygwin: serial: wait for CancelIo completion
@ 2020-03-16 9:20 Corinna Vinschen
0 siblings, 0 replies; only message in thread
From: Corinna Vinschen @ 2020-03-16 9:20 UTC (permalink / raw)
To: cygwin-cvs
https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=7947581905637b837558ae9a2f1d35b8ab433e90
commit 7947581905637b837558ae9a2f1d35b8ab433e90
Author: Corinna Vinschen <corinna@vinschen.de>
Date: Mon Mar 16 10:20:16 2020 +0100
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>
Diff:
---
winsup/cygwin/fhandler_serial.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/winsup/cygwin/fhandler_serial.cc b/winsup/cygwin/fhandler_serial.cc
index f92fc7039..f729765e0 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;
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2020-03-16 9:20 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-16 9:20 [newlib-cygwin] Cygwin: serial: wait for CancelIo completion Corinna Vinschen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).