From dbe0f4f28481aa84ae6010e442c3803704335630 Mon Sep 17 00:00:00 2001 From: Pat Hickey Date: Wed, 16 Dec 2020 15:54:46 -0800 Subject: [PATCH] Revert "dangling_fd test: open with either READ or CREAT|WRITE" fix for behavior in wasi-c2 coming in next commit This reverts commit 789eec382768d49c994a0d9c65a3e66d3bb2bac8. --- .../wasi-tests/src/bin/dangling_fd.rs | 25 +++---------------- 1 file changed, 3 insertions(+), 22 deletions(-) diff --git a/crates/test-programs/wasi-tests/src/bin/dangling_fd.rs b/crates/test-programs/wasi-tests/src/bin/dangling_fd.rs index b2ee63c4e8..e63ecbc8d7 100644 --- a/crates/test-programs/wasi-tests/src/bin/dangling_fd.rs +++ b/crates/test-programs/wasi-tests/src/bin/dangling_fd.rs @@ -5,35 +5,16 @@ use wasi_tests::open_scratch_directory; unsafe fn test_dangling_fd(dir_fd: wasi::Fd) { // Create a file, open it, delete it without closing the handle, // and then try creating it again - let fd = wasi::path_open( - dir_fd, - 0, - "file", - wasi::OFLAGS_CREAT, - wasi::RIGHTS_FD_WRITE, - 0, - 0, - ) - .unwrap(); + let fd = wasi::path_open(dir_fd, 0, "file", wasi::OFLAGS_CREAT, 0, 0, 0).unwrap(); wasi::fd_close(fd).unwrap(); - let file_fd = - wasi::path_open(dir_fd, 0, "file", 0, wasi::RIGHTS_FD_READ, 0, 0).expect("failed to open"); + let file_fd = wasi::path_open(dir_fd, 0, "file", 0, 0, 0, 0).expect("failed to open"); assert_gt!( file_fd, libc::STDERR_FILENO as wasi::Fd, "file descriptor range check", ); wasi::path_unlink_file(dir_fd, "file").expect("failed to unlink"); - let fd = wasi::path_open( - dir_fd, - 0, - "file", - wasi::OFLAGS_CREAT, - wasi::RIGHTS_FD_WRITE, - 0, - 0, - ) - .unwrap(); + let fd = wasi::path_open(dir_fd, 0, "file", wasi::OFLAGS_CREAT, 0, 0, 0).unwrap(); wasi::fd_close(fd).unwrap(); // Now, repeat the same process but for a directory