diff --git a/build.rs b/build.rs index 35b0e34ced..3a2e6ff7d5 100644 --- a/build.rs +++ b/build.rs @@ -186,7 +186,6 @@ mod wasm_tests { "fd_readdir" => true, "path_rename_trailing_slashes" => true, "path_symlink_trailing_slashes" => true, - "remove_directory_trailing_slashes" => true, _ => false, } } else { diff --git a/src/sys/windows/host_impl.rs b/src/sys/windows/host_impl.rs index df6991f1c5..5050cbd46c 100644 --- a/src/sys/windows/host_impl.rs +++ b/src/sys/windows/host_impl.rs @@ -2,7 +2,7 @@ #![allow(non_camel_case_types)] #![allow(non_snake_case)] #![allow(unused)] -use crate::{host, Result, Error}; +use crate::{host, Error, Result}; use std::ffi::OsStr; use std::fs::OpenOptions; use std::os::windows::ffi::OsStrExt; @@ -34,6 +34,7 @@ pub(crate) fn errno_from_win(error: winx::winerror::WinError) -> host::__wasi_er ERROR_BUFFER_OVERFLOW => host::__WASI_ENAMETOOLONG, ERROR_NOT_A_REPARSE_POINT => host::__WASI_EINVAL, ERROR_NEGATIVE_SEEK => host::__WASI_EINVAL, + ERROR_DIRECTORY => host::__WASI_ENOTDIR, _ => host::__WASI_ENOTSUP, } } diff --git a/winx/src/winerror.rs b/winx/src/winerror.rs index e6237267db..12392558c0 100644 --- a/winx/src/winerror.rs +++ b/winx/src/winerror.rs @@ -84,6 +84,8 @@ win_error_expand! { ERROR_NOT_A_REPARSE_POINT, /// An attempt was made to move the file pointer before the beginning of the file. ERROR_NEGATIVE_SEEK, + /// The directory name is invalid. + ERROR_DIRECTORY, } impl WinError {