Skip to content

Commit

Permalink
windows gives ERRNO_ACCES when reading or writing a file without that…
Browse files Browse the repository at this point in the history
… access mode
  • Loading branch information
Pat Hickey committed May 25, 2023
1 parent d808cce commit 4012e49
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ unsafe fn test_path_open_read_write(dir_fd: wasi::Fd) {
wasi::fd_write(f_readonly, &[ciovec])
.err()
.expect("read of writeonly fails"),
wasi::ERRNO_BADF
windows => wasi::ERRNO_ACCES,
unix => wasi::ERRNO_BADF
);

wasi::fd_close(f_readonly).expect("close readonly");
Expand All @@ -76,7 +77,8 @@ unsafe fn test_path_open_read_write(dir_fd: wasi::Fd) {
wasi::fd_read(f_writeonly, &[iovec])
.err()
.expect("read of writeonly fails"),
wasi::ERRNO_BADF
windows => wasi::ERRNO_ACCES,
unix => wasi::ERRNO_BADF
);
let bytes_written = wasi::fd_write(f_writeonly, &[ciovec]).expect("write to writeonly");
assert_eq!(bytes_written, write_buffer.len());
Expand Down

0 comments on commit 4012e49

Please sign in to comment.