Don't allow a preopened file descriptor to be renamed over.

This is consistent with fd_close's behavior, and is likely temporary
until other options are designed.
This commit is contained in:
Dan Gohman
2019-04-23 12:41:16 -07:00
parent 7813cc9d2d
commit f10cd2f4b1
3 changed files with 20 additions and 1 deletions

View File

@@ -573,10 +573,11 @@ syscalls! {
let vmctx = &mut *vmctx;
let curfds = get_curfds(vmctx);
let prestats = get_prestats(vmctx);
let from = decode_fd(from);
let to = decode_fd(to);
let e = host::wasmtime_ssp_fd_renumber(curfds, from, to);
let e = host::wasmtime_ssp_fd_renumber(curfds, prestats, from, to);
return_encoded_errno(e)
}