Fix path_rename on *nix hosts

The fix contains an errno remapping in macOS case where in case
when we try to rename a file into a path with a trailing slash an
ENOENT is returned. In this case, if the destination does not exist,
an ENOTDIR should be thrown as is thrown correctly on Linux hosts.
Thus, as a fix, if an ENOENT is thrown, an additional check is
performed to see whether the destination path indeed contains
a trailing slash, and if so, the errno is adjusted to ENOTDIR
to match the POSIX/WASI spec.
This commit is contained in:
Jakub Konka
2019-09-17 23:03:31 +02:00
parent 90f1cd5c96
commit d33036a3b5
5 changed files with 77 additions and 23 deletions

View File

@@ -163,7 +163,6 @@ cfg_if::cfg_if! {
fn ignore(testsuite: &str, name: &str) -> bool {
if testsuite == "misc_testsuite" {
match name {
"path_rename_trailing_slashes" => true,
"path_symlink_trailing_slashes" => true,
_ => false,
}