diff --git a/lib/wasi/src/syscalls/mod.rs b/lib/wasi/src/syscalls/mod.rs index 49b48062b..0309367c5 100644 --- a/lib/wasi/src/syscalls/mod.rs +++ b/lib/wasi/src/syscalls/mod.rs @@ -1979,9 +1979,9 @@ pub fn path_remove_directory( let host_path_to_remove = match &state.fs.inodes[inode].kind { Kind::Dir { entries, path, .. } => { - if !entries.is_empty() { - return __WASI_ENOTEMPTY; - } else if wasi_try!(std::fs::read_dir(path).ok(), __WASI_EIO).count() != 0 { + if !entries.is_empty() + || wasi_try!(std::fs::read_dir(path).ok(), __WASI_EIO).count() != 0 + { return __WASI_ENOTEMPTY; } path.clone()