Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'winsup/cygwin/fhandler.cc')
-rw-r--r--winsup/cygwin/fhandler.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/winsup/cygwin/fhandler.cc b/winsup/cygwin/fhandler.cc
index 2e909fbd1..16ec8114d 100644
--- a/winsup/cygwin/fhandler.cc
+++ b/winsup/cygwin/fhandler.cc
@@ -1772,21 +1772,22 @@ fhandler_base::wait_overlapped (bool inres, bool writing, DWORD *bytes, DWORD le
void
fhandler_base::read_overlapped (void *ptr, size_t& len)
{
+ DWORD bytes_written;
while (1)
{
- bool res = ReadFile (get_handle (), ptr, len, (DWORD *) &len,
+ bool res = ReadFile (get_handle (), ptr, len, &bytes_written,
get_overlapped ());
- int wres = wait_overlapped (res, false, (DWORD *) &len);
+ int wres = wait_overlapped (res, false, &bytes_written);
if (wres || !_my_tls.call_signal_handler ())
break;
}
+ len = (size_t) bytes_written;
}
int
fhandler_base::write_overlapped (const void *ptr, size_t len)
{
DWORD bytes_written;
-
while (1)
{
bool res = WriteFile (get_output_handle (), ptr, len, &bytes_written,