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.
```
This commit is contained in:
Jeremy Fillingim 2021-11-28 03:40:50 +00:00 committed by Andrew Kelley
parent 1e0addcf73
commit 89afd4bd33

View File

@ -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,