Only check for evented mode in windows.OpenFile when in async mode

This commit is contained in:
Alexandros Naskos
2020-12-17 11:08:21 +02:00
parent aa6654a4b3
commit 85cc3f24a0

View File

@@ -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;