failure to create trailing slash symlink to file can be EEXIST or ENOTDIR
This commit is contained in:
@@ -40,12 +40,12 @@ unsafe fn test_path_symlink_trailing_slashes(dir_fd: wasi::Fd) {
|
|||||||
// Link destination already exists, target has trailing slash.
|
// Link destination already exists, target has trailing slash.
|
||||||
create_file(dir_fd, "target");
|
create_file(dir_fd, "target");
|
||||||
|
|
||||||
assert_eq!(
|
let dir_symlink_errno = wasi::path_symlink("source", dir_fd, "target/")
|
||||||
wasi::path_symlink("source", dir_fd, "target/")
|
.expect_err("link destination already exists")
|
||||||
.expect_err("link destination already exists")
|
.raw_error();
|
||||||
.raw_error(),
|
assert!(
|
||||||
wasi::ERRNO_EXIST,
|
dir_symlink_errno == wasi::ERRNO_EXIST || dir_symlink_errno == wasi::ERRNO_NOTDIR,
|
||||||
"errno should be ERRNO_EXIST"
|
"errno should be ERRNO_EXIST or ERRNO_NOTDIR"
|
||||||
);
|
);
|
||||||
wasi::path_unlink_file(dir_fd, "target").expect("removing a file");
|
wasi::path_unlink_file(dir_fd, "target").expect("removing a file");
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user