authorgravatar for leroycepearson@geemili.xyzLeRoyce Pearson <leroycepearson@geemili.xyz> 2020-03-23 22:34:00-06:00
committergravatar for leroycepearson@geemili.xyzLeRoyce Pearson <leroycepearson@geemili.xyz> 2020-03-23 22:34:00-06:00
log8bec1304c35585ceacfbda3696d8af854c7ab08a
tree9b2eb09c7f922e87b9fe436be73999aa715514f5
parent113b217593ab5b0369b76251b99a195f361cc220

Fix compile error on windows


2 files changed, 4 insertions(+), 2 deletions(-)

lib/std/os.zig+1-1
...@@ -1651,7 +1651,7 @@ pub fn renameatW(...@@ -1651,7 +1651,7 @@ pub fn renameatW(
1651 ReplaceIfExists: windows.BOOLEAN,1651 ReplaceIfExists: windows.BOOLEAN,
1652) RenameError!void {1652) RenameError!void {
1653 const access_mask = windows.SYNCHRONIZE | windows.GENERIC_WRITE | windows.DELETE;1653 const access_mask = windows.SYNCHRONIZE | windows.GENERIC_WRITE | windows.DELETE;
1654 const src_fd = try windows.OpenFileW(old_dir_fd, old_path, null, access_mask, windows.FILE_OPEN);1654 const src_fd = try windows.OpenFileW(old_dir_fd, old_path, null, access_mask, null, windows.FILE_OPEN);
1655 defer windows.CloseHandle(src_fd);1655 defer windows.CloseHandle(src_fd);
16561656
1657 const struct_buf_len = @sizeOf(windows.FILE_RENAME_INFORMATION) + (MAX_PATH_BYTES - 1);1657 const struct_buf_len = @sizeOf(windows.FILE_RENAME_INFORMATION) + (MAX_PATH_BYTES - 1);
lib/std/os/windows.zig+3-1
...@@ -107,6 +107,7 @@ pub fn OpenFileW(...@@ -107,6 +107,7 @@ pub fn OpenFileW(
107 sub_path_w: [*:0]const u16,107 sub_path_w: [*:0]const u16,
108 sa: ?*SECURITY_ATTRIBUTES,108 sa: ?*SECURITY_ATTRIBUTES,
109 access_mask: ACCESS_MASK,109 access_mask: ACCESS_MASK,
110 share_access_opt: ?ULONG,
110 creation: ULONG,111 creation: ULONG,
111) OpenError!HANDLE {112) OpenError!HANDLE {
112 if (sub_path_w[0] == '.' and sub_path_w[1] == 0) {113 if (sub_path_w[0] == '.' and sub_path_w[1] == 0) {
...@@ -135,6 +136,7 @@ pub fn OpenFileW(...@@ -135,6 +136,7 @@ pub fn OpenFileW(
135 .SecurityQualityOfService = null,136 .SecurityQualityOfService = null,
136 };137 };
137 var io: IO_STATUS_BLOCK = undefined;138 var io: IO_STATUS_BLOCK = undefined;
139 const share_access = share_access_opt orelse FILE_SHARE_WRITE | FILE_SHARE_READ | FILE_SHARE_DELETE;
138 const rc = ntdll.NtCreateFile(140 const rc = ntdll.NtCreateFile(
139 &result,141 &result,
140 access_mask,142 access_mask,
...@@ -142,7 +144,7 @@ pub fn OpenFileW(...@@ -142,7 +144,7 @@ pub fn OpenFileW(
142 &io,144 &io,
143 null,145 null,
144 FILE_ATTRIBUTE_NORMAL,146 FILE_ATTRIBUTE_NORMAL,
145 FILE_SHARE_WRITE | FILE_SHARE_READ | FILE_SHARE_DELETE,147 share_access,
146 creation,148 creation,
147 FILE_NON_DIRECTORY_FILE | FILE_SYNCHRONOUS_IO_NONALERT,149 FILE_NON_DIRECTORY_FILE | FILE_SYNCHRONOUS_IO_NONALERT,
148 null,150 null,