Skip to content

Commit

Permalink
Fix error code for path_rename of a non-existant file
Browse files Browse the repository at this point in the history
Fixes #2534
  • Loading branch information
Amanieu committed Nov 8, 2021
1 parent e389ad0 commit dbba897
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/wasi/src/syscalls/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2073,7 +2073,7 @@ pub fn path_rename(

let source_entry = match &mut state.fs.inodes[source_parent_inode].kind {
Kind::Dir { entries, .. } => {
wasi_try!(entries.remove(&source_entry_name), __WASI_EINVAL)
wasi_try!(entries.remove(&source_entry_name), __WASI_ENOENT)
}
Kind::Root { .. } => return __WASI_ENOTCAPABLE,
Kind::Symlink { .. } | Kind::File { .. } | Kind::Buffer { .. } => {
Expand Down

0 comments on commit dbba897

Please sign in to comment.