From dbba897f927ebffc3833f189b33e810b48eeaa44 Mon Sep 17 00:00:00 2001 From: Amanieu d'Antras Date: Mon, 8 Nov 2021 14:57:39 +0000 Subject: [PATCH] Fix error code for path_rename of a non-existant file Fixes #2534 --- lib/wasi/src/syscalls/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/wasi/src/syscalls/mod.rs b/lib/wasi/src/syscalls/mod.rs index ec3648f30cf..b1971d24e15 100644 --- a/lib/wasi/src/syscalls/mod.rs +++ b/lib/wasi/src/syscalls/mod.rs @@ -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 { .. } => {