authorgravatar for leroycepearson@geemili.xyzLeRoyce Pearson <leroycepearson@geemili.xyz> 2020-04-08 00:39:17-06:00
committergravatar for leroycepearson@geemili.xyzLeRoyce Pearson <leroycepearson@geemili.xyz> 2020-04-08 00:39:17-06:00
log45d6fb9e3691120428a70f659cc211faf6cb1897
tree73de2be38ce755dd36ac1f02e8fd56a5b3f7844b
parent858aefac7f6085b60d32de053f109f36896ab2ca

Catch error.WouldBlock as unreachable


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

lib/std/os.zig+4-1
...@@ -1680,7 +1680,10 @@ pub fn renameatW(...@@ -1680,7 +1680,10 @@ pub fn renameatW(
1680 ReplaceIfExists: windows.BOOLEAN,1680 ReplaceIfExists: windows.BOOLEAN,
1681) RenameError!void {1681) RenameError!void {
1682 const access_mask = windows.SYNCHRONIZE | windows.GENERIC_WRITE | windows.DELETE;1682 const access_mask = windows.SYNCHRONIZE | windows.GENERIC_WRITE | windows.DELETE;
1683 const src_fd = try windows.OpenFileW(old_dir_fd, old_path, null, access_mask, null, false, windows.FILE_OPEN);1683 const src_fd = windows.OpenFileW(old_dir_fd, old_path, null, access_mask, null, false, windows.FILE_OPEN) catch |err| switch (err) {
1684 error.WouldBlock => unreachable,
1685 else => return err,
1686 };
1684 defer windows.CloseHandle(src_fd);1687 defer windows.CloseHandle(src_fd);
16851688
1686 const struct_buf_len = @sizeOf(windows.FILE_RENAME_INFORMATION) + (MAX_PATH_BYTES - 1);1689 const struct_buf_len = @sizeOf(windows.FILE_RENAME_INFORMATION) + (MAX_PATH_BYTES - 1);