mirror of
https://github.com/ziglang/zig.git
synced 2026-02-21 16:54:52 +00:00
std: fix windows.GetOverlappedResult
This commit is contained in:
parent
ce9966a39b
commit
6b5b0e6cd6
@ -141,9 +141,9 @@ pub fn DeviceIoControl(
|
||||
|
||||
pub fn GetOverlappedResult(h: HANDLE, overlapped: *OVERLAPPED, wait: bool) !DWORD {
|
||||
var bytes: DWORD = undefined;
|
||||
if (kernel32.GetOverlappedResult(h, overlapped, &bytes, wait) == 0) {
|
||||
if (kernel32.GetOverlappedResult(h, overlapped, &bytes, @boolToInt(wait)) == 0) {
|
||||
switch (kernel32.GetLastError()) {
|
||||
ERROR_IO_INCOMPLETE => if (!wait) return error.WouldBlock else unreachable,
|
||||
ERROR.IO_INCOMPLETE => if (!wait) return error.WouldBlock else unreachable,
|
||||
else => |err| return unexpectedError(err),
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user