From 68ed787751ed36af3db0c52031741a5c31413034 Mon Sep 17 00:00:00 2001 From: kcbanner Date: Mon, 16 Oct 2023 23:29:16 -0400 Subject: [PATCH] windows: fix ReadLink not using a synchronous file handle --- lib/std/os/windows.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/std/os/windows.zig b/lib/std/os/windows.zig index 7c0289b689..d38a63ef39 100644 --- a/lib/std/os/windows.zig +++ b/lib/std/os/windows.zig @@ -836,14 +836,14 @@ pub fn ReadLink(dir: ?HANDLE, sub_path_w: []const u16, out_buffer: []u8) ReadLin const rc = ntdll.NtCreateFile( &result_handle, - FILE_READ_ATTRIBUTES, + FILE_READ_ATTRIBUTES | SYNCHRONIZE, &attr, &io, null, FILE_ATTRIBUTE_NORMAL, FILE_SHARE_READ, FILE_OPEN, - FILE_OPEN_REPARSE_POINT, + FILE_OPEN_REPARSE_POINT | FILE_SYNCHRONOUS_IO_NONALERT, null, 0, );