From f084cf1fd07319e8e6178acc0dc6cebd18eef7b0 Mon Sep 17 00:00:00 2001 From: Pat Hickey Date: Mon, 11 Jan 2021 15:56:13 -0800 Subject: [PATCH] failure to create trailing slash symlink to file can be EEXIST or ENOTDIR --- .../src/bin/path_symlink_trailing_slashes.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/crates/test-programs/wasi-tests/src/bin/path_symlink_trailing_slashes.rs b/crates/test-programs/wasi-tests/src/bin/path_symlink_trailing_slashes.rs index e8e1d7fb2f..2946fba197 100644 --- a/crates/test-programs/wasi-tests/src/bin/path_symlink_trailing_slashes.rs +++ b/crates/test-programs/wasi-tests/src/bin/path_symlink_trailing_slashes.rs @@ -40,12 +40,12 @@ unsafe fn test_path_symlink_trailing_slashes(dir_fd: wasi::Fd) { // Link destination already exists, target has trailing slash. create_file(dir_fd, "target"); - assert_eq!( - wasi::path_symlink("source", dir_fd, "target/") - .expect_err("link destination already exists") - .raw_error(), - wasi::ERRNO_EXIST, - "errno should be ERRNO_EXIST" + let dir_symlink_errno = wasi::path_symlink("source", dir_fd, "target/") + .expect_err("link destination already exists") + .raw_error(); + assert!( + dir_symlink_errno == wasi::ERRNO_EXIST || dir_symlink_errno == wasi::ERRNO_NOTDIR, + "errno should be ERRNO_EXIST or ERRNO_NOTDIR" ); wasi::path_unlink_file(dir_fd, "target").expect("removing a file");