Skip to content

Commit

Permalink
Merge pull request #4720 from wasmerio/revert-existing-directory-fix
Browse files Browse the repository at this point in the history
Revert "make path_create_directory return error if no dir was created"
  • Loading branch information
syrusakbary authored May 20, 2024
2 parents f8d29ec + e711829 commit 22c2415
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
8 changes: 1 addition & 7 deletions lib/wasix/src/syscalls/wasi/path_create_directory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ pub(crate) fn path_create_directory_internal(
return Err(Errno::Inval);
}

let mut created_dir = false;
let mut cur_dir_inode = working_dir.inode;
for comp in &path_vec {
let processing_cur_dir_inode = cur_dir_inode.clone();
Expand Down Expand Up @@ -126,7 +125,6 @@ pub(crate) fn path_create_directory_internal(
return Err(Errno::Notdir);
}
} else {
created_dir = true;
state.fs_create_dir(&adjusted_path)?;
}
let kind = Kind::Dir {
Expand Down Expand Up @@ -162,9 +160,5 @@ pub(crate) fn path_create_directory_internal(
}
}

if created_dir {
Ok(())
} else {
Err(Errno::Exist)
}
Ok(())
}
2 changes: 1 addition & 1 deletion tests/wasi-fyi/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ bash build.sh
status=0

# Define skip list as an array
SKIP_LIST=()
SKIP_LIST=("fs_create_dir-existing-directory.wasm")

# List and process .foo files
for file in *.wasm; do
Expand Down

0 comments on commit 22c2415

Please sign in to comment.