Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix error code returned by some wasi fs syscalls for a non-existent file #2672

Merged
merged 2 commits into from
Nov 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ Looking for changes that affect our C API? See the [C API Changelog](lib/c-api/C
- [#2454](https://github.com/wasmerio/wasmer/issues/2454) Won't set `WASMER_CACHE_DIR` for Windows.
- [#2426](https://github.com/wasmerio/wasmer/pull/2426) Fix the `wax` script generation.
- [#2635](https://github.com/wasmerio/wasmer/pull/2635) Fix cross-compilation for singlepass.
- [#2672](https://github.com/wasmerio/wasmer/pull/2672) Use `ENOENT` instead of `EINVAL` in some WASI syscalls for a non-existent file

## 2.0.0 - 2021/06/16

Expand Down
4 changes: 2 additions & 2 deletions lib/wasi/src/state/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -766,7 +766,7 @@ impl WasiFs {
.fs_backing
.symlink_metadata(&file)
.ok()
.ok_or(__WASI_EINVAL)?;
.ok_or(__WASI_ENOENT)?;
let file_type = metadata.file_type();
// we want to insert newly opened dirs and files, but not transient symlinks
// TODO: explain why (think about this deeply when well rested)
Expand Down Expand Up @@ -894,7 +894,7 @@ impl WasiFs {
{
cur_inode = *entry;
} else {
return Err(__WASI_EINVAL);
return Err(__WASI_ENOENT);
}
}
Kind::File { .. } => {
Expand Down