Skip to content

Commit 5932550

Browse files
authored
Merge branch 'master' into fix/misc-wasi-fs-issues
2 parents 8a99e5c + 9120723 commit 5932550

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

lib/wasi/src/syscalls/mod.rs

+6-8
Original file line numberDiff line numberDiff line change
@@ -848,15 +848,13 @@ pub fn fd_renumber(ctx: &mut Ctx, from: __wasi_fd_t, to: __wasi_fd_t) -> __wasi_
848848
debug!("wasi::fd_renumber: from={}, to={}", from, to);
849849
let state = get_wasi_state(ctx);
850850
let fd_entry = wasi_try!(state.fs.fd_map.get(&from).ok_or(__WASI_EBADF));
851+
let new_fd_entry = Fd {
852+
// TODO: verify this is correct
853+
rights: fd_entry.rights_inheriting,
854+
..*fd_entry
855+
};
851856

852-
state.fs.fd_map.insert(
853-
to,
854-
Fd {
855-
// TODO: verify this is correct
856-
rights: fd_entry.rights_inheriting,
857-
..*fd_entry
858-
},
859-
);
857+
state.fs.fd_map.insert(to, new_fd_entry);
860858
state.fs.fd_map.remove(&from);
861859
__WASI_ESUCCESS
862860
}

0 commit comments

Comments
 (0)