Skip to content

Commit

Permalink
wasi_fd_allocate: reject directory explicitly
Browse files Browse the repository at this point in the history
this seems like a bug in wasi-testsuite.
cf. WebAssembly/wasi-testsuite#98
  • Loading branch information
yamt committed Feb 1, 2024
1 parent bbda213 commit ab34097
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions libwasi/wasi.c
Original file line number Diff line number Diff line change
Expand Up @@ -875,6 +875,10 @@ wasi_fd_allocate(struct exec_context *ctx, struct host_instance *hi,
* macOS doesn't have posix_fallocate
* cf. https://github.com/WebAssembly/wasi-filesystem/issues/19
*/
ret = reject_directory(hostfd);
if (ret != 0) {
goto fail;
}
#if defined(__APPLE__)
ret = racy_fallocate(hostfd, offset, len);
#else
Expand Down

0 comments on commit ab34097

Please sign in to comment.