From 315885c1eb40bc50786d0da7cea85720e0278e15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Moreau?= Date: Fri, 28 Feb 2014 11:24:44 -0500 Subject: [PATCH] libwinpr-file: fix improper status code in overlapped i/o --- winpr/libwinpr/file/file.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/winpr/libwinpr/file/file.c b/winpr/libwinpr/file/file.c index f23763d14..7d8fb3ab0 100644 --- a/winpr/libwinpr/file/file.c +++ b/winpr/libwinpr/file/file.c @@ -370,7 +370,7 @@ BOOL ReadFile(HANDLE hFile, LPVOID lpBuffer, DWORD nNumberOfBytesToRead, { case ECONNRESET: SetLastError(ERROR_BROKEN_PIPE); - io_status = -1; + io_status = 0; break; } } @@ -386,7 +386,7 @@ BOOL ReadFile(HANDLE hFile, LPVOID lpBuffer, DWORD nNumberOfBytesToRead, } } - *lpNumberOfBytesRead = status; + *lpNumberOfBytesRead = io_status; } else {