When path_open fails, set the output fd to -1.

This commit is contained in:
Dan Gohman
2019-04-23 12:31:46 -07:00
parent 86b7a52009
commit e62607e552

View File

@@ -914,7 +914,7 @@ syscalls! {
let fs_rights_base = decode_rights(fs_rights_base); let fs_rights_base = decode_rights(fs_rights_base);
let fs_rights_inheriting = decode_rights(fs_rights_inheriting); let fs_rights_inheriting = decode_rights(fs_rights_inheriting);
let fs_flags = decode_fdflags(fs_flags); let fs_flags = decode_fdflags(fs_flags);
let mut host_fd = 0; let mut host_fd = wasm32::__wasi_fd_t::max_value();
if let Err(e) = decode_fd_byref(vmctx, fd) { if let Err(e) = decode_fd_byref(vmctx, fd) {
return return_encoded_errno(e); return return_encoded_errno(e);
} }