diff --git a/tensorflow/core/platform/windows/windows_file_system.cc b/tensorflow/core/platform/windows/windows_file_system.cc index 670abf3fdf77a314b22883acaa0f1a02a30d06b4..facadc7f57f2c80dd44850cbad2736891adb4375 100644 --- a/tensorflow/core/platform/windows/windows_file_system.cc +++ b/tensorflow/core/platform/windows/windows_file_system.cc @@ -72,7 +72,9 @@ SSIZE_T pread(HANDLE hfile, char* src, size_t num_bytes, uint64_t offset) { BOOL read_result = ::ReadFile(hfile, src, static_cast(num_bytes), &bytes_read, &overlapped); - if ((FALSE == read_result) && + if (TRUE == read_result) { + result = bytes_read; + } else if ((FALSE == read_result) && ((last_error = GetLastError()) != ERROR_IO_PENDING)) { result = (last_error == ERROR_HANDLE_EOF) ? 0 : -1; } else {