diff options
Diffstat (limited to 'tensorflow/core/platform/windows/windows_file_system.cc')
-rw-r--r-- | tensorflow/core/platform/windows/windows_file_system.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/tensorflow/core/platform/windows/windows_file_system.cc b/tensorflow/core/platform/windows/windows_file_system.cc index 670abf3fdf..facadc7f57 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<DWORD>(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 { |