Skip to content

Commit 1209cf5

Browse files
illarionovloganek
authored andcommitted
Close file_fd in path_link preventing file deletion on windows
Unclosed file_fd prevents deletion of file and its directory on Windows
1 parent b58a555 commit 1209cf5

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

tests/rust/src/bin/path_link.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ unsafe fn test_path_link(dir_fd: wasi::Fd) {
9494
wasi::path_unlink_file(subdir_fd, "link").expect("removing a link");
9595
wasi::fd_close(subdir_fd).expect("Closing subdir_fd"); // needed for Windows
9696
wasi::fd_close(link_fd).expect("Closing link_fd"); // needed for Windows
97+
wasi::fd_close(file_fd).expect("Closing file_fd"); // needed for Windows
9798
wasi::path_remove_directory(dir_fd, "subdir").expect("removing a subdirectory");
9899

99100
// Create a link to a path that already exists

0 commit comments

Comments
 (0)