authorgravatar for jeremy@fillingim.netJeremy Fillingim <jeremy@fillingim.net> 2021-11-28 03:40:50+00:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-11-30 17:38:21-08:00
log89afd4bd33c72c2e608974d182f4624078da3a7f
tree99762897b2e0f317fa58157e0ad02a18a05d796a
parent1e0addcf73ee71d23a41b744995848bcca38e8d3

libstd: handle rmdirZ INVAL error (#10145)

The INVAL error was marked unreachable which prevents handling of the error at a higher level. It seems like it should map to BadPathError based on the man page for rmdir (and an incomplete understanding of DeleteDirError), which says: ``` EINVAL pathname has . as last component. ```

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

lib/std/os.zig+1-1
......@@ -2538,7 +2538,7 @@ pub fn rmdirZ(dir_path: [*:0]const u8) DeleteDirError!void {
25382538 .PERM => return error.AccessDenied,
25392539 .BUSY => return error.FileBusy,
25402540 .FAULT => unreachable,
2541 .INVAL => unreachable,
2541 .INVAL => return error.BadPathName,
25422542 .LOOP => return error.SymLinkLoop,
25432543 .NAMETOOLONG => return error.NameTooLong,
25442544 .NOENT => return error.FileNotFound,