mirror of
https://codeberg.org/ziglang/zig.git
synced 2026-03-08 01:04:43 +01:00
std.Io.Threaded.dirCreateDirWindows: remove unexpected error handling
This commit is contained in:
parent
0e7d00776e
commit
3078a3197b
1 changed files with 2 additions and 7 deletions
|
|
@ -3321,7 +3321,7 @@ fn dirCreateDirWindows(userdata: ?*anyopaque, dir: Dir, sub_path: []const u8, pe
|
|||
// after an executable file is closed. Here we work around the
|
||||
// kernel bug with retry attempts.
|
||||
syscall.finish();
|
||||
if (max_windows_kernel_bug_retries - attempt == 0) return error.FileBusy;
|
||||
if (max_windows_kernel_bug_retries - attempt == 0) return error.Unexpected;
|
||||
try parking_sleep.sleep(.{ .duration = .{
|
||||
.raw = .fromMilliseconds((@as(u32, 1) << attempt) >> 1),
|
||||
.clock = .awake,
|
||||
|
|
@ -3338,7 +3338,7 @@ fn dirCreateDirWindows(userdata: ?*anyopaque, dir: Dir, sub_path: []const u8, pe
|
|||
// this other than retrying the creation after the OS finishes
|
||||
// the deletion.
|
||||
syscall.finish();
|
||||
if (max_windows_kernel_bug_retries - attempt == 0) return error.FileBusy;
|
||||
if (max_windows_kernel_bug_retries - attempt == 0) return error.Unexpected;
|
||||
try parking_sleep.sleep(.{ .duration = .{
|
||||
.raw = .fromMilliseconds((@as(u32, 1) << attempt) >> 1),
|
||||
.clock = .awake,
|
||||
|
|
@ -3352,15 +3352,10 @@ fn dirCreateDirWindows(userdata: ?*anyopaque, dir: Dir, sub_path: []const u8, pe
|
|||
.OBJECT_PATH_NOT_FOUND => return syscall.fail(error.FileNotFound),
|
||||
.BAD_NETWORK_PATH => return syscall.fail(error.NetworkNotFound), // \\server was not found
|
||||
.BAD_NETWORK_NAME => return syscall.fail(error.NetworkNotFound), // \\server was found but \\server\share wasn't
|
||||
.NO_MEDIA_IN_DEVICE => return syscall.fail(error.NoDevice),
|
||||
.ACCESS_DENIED => return syscall.fail(error.AccessDenied),
|
||||
.PIPE_BUSY => return syscall.fail(error.PipeBusy),
|
||||
.PIPE_NOT_AVAILABLE => return syscall.fail(error.NoDevice),
|
||||
.OBJECT_NAME_COLLISION => return syscall.fail(error.PathAlreadyExists),
|
||||
.FILE_IS_A_DIRECTORY => return syscall.fail(error.IsDir),
|
||||
.NOT_A_DIRECTORY => return syscall.fail(error.NotDir),
|
||||
.USER_MAPPED_FILE => return syscall.fail(error.AccessDenied),
|
||||
.VIRUS_INFECTED, .VIRUS_DELETED => return syscall.fail(error.AntivirusInterference),
|
||||
.INVALID_PARAMETER => |status| return syscall.ntstatusBug(status),
|
||||
.OBJECT_PATH_SYNTAX_BAD => |status| return syscall.ntstatusBug(status),
|
||||
.INVALID_HANDLE => |status| return syscall.ntstatusBug(status),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue