Commit 85cc3f24a0

Alexandros Naskos <alex_naskos@hotmail.com>
2020-12-17 10:08:21
Only check for evented mode in windows.OpenFile when in async mode
1 parent aa6654a
Changed files (1)
lib
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;