aboutsummaryrefslogtreecommitdiff
path: root/lib/std/os
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2020-09-29 17:26:09 -0700
committerAndrew Kelley <andrew@ziglang.org>2020-09-29 17:26:09 -0700
commitaf64fd2f424401ff66638696b35b1bf385c4b039 (patch)
treebfd10169c9af10e947dfbbe593ad353604074f62 /lib/std/os
parent27e008eb292038c5a6b9a13b64c7b69d1525f690 (diff)
parentd1cea16f5cd29eb143ff9b3302e7ec56731647ea (diff)
downloadzig-af64fd2f424401ff66638696b35b1bf385c4b039.tar.gz
zig-af64fd2f424401ff66638696b35b1bf385c4b039.zip
Merge remote-tracking branch 'origin/master' into stage2-zig-cc
This merges in the revert that fixes the broken Windows build of master branch.
Diffstat (limited to 'lib/std/os')
-rw-r--r--lib/std/os/windows.zig18
1 files changed, 1 insertions, 17 deletions
diff --git a/lib/std/os/windows.zig b/lib/std/os/windows.zig
index 54d19cb21b..579215cf12 100644
--- a/lib/std/os/windows.zig
+++ b/lib/std/os/windows.zig
@@ -765,7 +765,6 @@ pub const DeleteFileError = error{
Unexpected,
NotDir,
IsDir,
- DirNotEmpty,
};
pub const DeleteFileOptions = struct {
@@ -820,7 +819,7 @@ pub fn DeleteFile(sub_path_w: []const u16, options: DeleteFileOptions) DeleteFil
0,
);
switch (rc) {
- .SUCCESS => CloseHandle(tmp_handle),
+ .SUCCESS => return CloseHandle(tmp_handle),
.OBJECT_NAME_INVALID => unreachable,
.OBJECT_NAME_NOT_FOUND => return error.FileNotFound,
.INVALID_PARAMETER => unreachable,
@@ -829,21 +828,6 @@ pub fn DeleteFile(sub_path_w: []const u16, options: DeleteFileOptions) DeleteFil
.SHARING_VIOLATION => return error.FileBusy,
else => return unexpectedStatus(rc),
}
-
- // If a directory fails to be deleted, CloseHandle will still report success
- // Check if the directory still exists and return error.DirNotEmpty if true
- if (options.remove_dir) {
- var basic_info: FILE_BASIC_INFORMATION = undefined;
- switch (ntdll.NtQueryAttributesFile(&attr, &basic_info)) {
- .SUCCESS => return error.DirNotEmpty,
- .OBJECT_NAME_NOT_FOUND => return,
- .OBJECT_PATH_NOT_FOUND => return,
- .INVALID_PARAMETER => unreachable,
- .ACCESS_DENIED => return error.AccessDenied,
- .OBJECT_PATH_SYNTAX_BAD => unreachable,
- else => |urc| return unexpectedStatus(urc),
- }
- }
}
pub const MoveFileError = error{ FileNotFound, Unexpected };