Skip to content

Commit

Permalink
Merge branch 'fix/misc-wasi-fs-issues' of github.com:wasmerio/wasmer …
Browse files Browse the repository at this point in the history
…into fix/misc-wasi-fs-issues
  • Loading branch information
MarkMcCaskey committed May 15, 2019
2 parents c402c03 + 5932550 commit 216d09b
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions lib/wasi/src/syscalls/mod.rs
Expand Up @@ -848,15 +848,13 @@ pub fn fd_renumber(ctx: &mut Ctx, from: __wasi_fd_t, to: __wasi_fd_t) -> __wasi_
debug!("wasi::fd_renumber: from={}, to={}", from, to);
let state = get_wasi_state(ctx);
let fd_entry = wasi_try!(state.fs.fd_map.get(&from).ok_or(__WASI_EBADF));
let new_fd_entry = Fd {
// TODO: verify this is correct
rights: fd_entry.rights_inheriting,
..*fd_entry
};

state.fs.fd_map.insert(
to,
Fd {
// TODO: verify this is correct
rights: fd_entry.rights_inheriting,
..*fd_entry
},
);
state.fs.fd_map.insert(to, new_fd_entry);
state.fs.fd_map.remove(&from);
__WASI_ESUCCESS
}
Expand Down

0 comments on commit 216d09b

Please sign in to comment.