windows: detect HANDLE_EOF in ReadFile

master
Andrew Kelley 2020-03-11 17:39:53 -04:00
parent 3657a54618
commit 06d2f53ece
No known key found for this signature in database
GPG Key ID: 7C5F548F728501A9
1 changed files with 1 additions and 0 deletions

View File

@ -407,6 +407,7 @@ pub fn ReadFile(in_hFile: HANDLE, buffer: []u8, offset: ?u64) ReadFileError!usiz
switch (kernel32.GetLastError()) {
.OPERATION_ABORTED => continue,
.BROKEN_PIPE => return index,
.HANDLE_EOF => return index,
else => |err| return unexpectedError(err),
}
}