commit 85cc3f24a0c1ee9957d0264bd7532441090cbd6c (tree)
parent aa6654a4b3c64499ccb4b16e1f7257e7da14ef81
Author: Alexandros Naskos <alex_naskos@hotmail.com>
Date: Thu, 17 Dec 2020 11:08:21 +0200
Only check for evented mode in windows.OpenFile when in async mode
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/std/os/windows.zig b/lib/std/os/windows.zig
@@ -110,7 +110,7 @@ pub fn OpenFile(sub_path_w: []const u16, options: OpenFileOptions) OpenError!HAN
);
switch (rc) {
.SUCCESS => {
- if (options.io_mode == .evented) {
+ if (std.io.is_async and options.io_mode == .evented) {
_ = CreateIoCompletionPort(result, std.event.Loop.instance.?.os_data.io_port, undefined, undefined) catch undefined;
}
return result;