Commit 89afd4bd33

Jeremy Fillingim <jeremy@fillingim.net>
2021-11-28 04:40:50
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 parent 1e0addc
Changed files (1)
lib
std
lib/std/os.zig
@@ -2538,7 +2538,7 @@ pub fn rmdirZ(dir_path: [*:0]const u8) DeleteDirError!void {
         .PERM => return error.AccessDenied,
         .BUSY => return error.FileBusy,
         .FAULT => unreachable,
-        .INVAL => unreachable,
+        .INVAL => return error.BadPathName,
         .LOOP => return error.SymLinkLoop,
         .NAMETOOLONG => return error.NameTooLong,
         .NOENT => return error.FileNotFound,