Skip to content

Commit

Permalink
Add all strace
Browse files Browse the repository at this point in the history
  • Loading branch information
KikiSpace committed Oct 10, 2023
1 parent c70c9e9 commit 7fa267b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/wamr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ int WAMRInstance::invoke_fopen(std::string &path, uint32 option) {
return -1;
};
int WAMRInstance::invoke_frenumber(uint32 fd, uint32 to) {
auto name = "fd_renumber";
auto name = "__wasi_fd_renumber";
if (!(func = wasm_runtime_lookup_function(module_inst, name, nullptr))) {
LOGV(ERROR) << "The wasi fopen function is not found.";
auto target_module = get_module_instance()->e;
Expand Down
2 changes: 1 addition & 1 deletion src/wamr_wasi_context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ void WAMRWASIContext::restore_impl(WASIContext *env) {
LOGV(INFO) << "fd: " << fd << " path: " << std::get<0>(res) << " flags: " << std::get<1>(res)
<< " offset: " << std::get<2>(res);
r = wamr->invoke_fopen(std::get<0>(res), std::get<1>(res));
if (r != fd)
if (fd != 0 && fd != 1 && fd != 2)
wamr->invoke_frenumber(r, fd);
wamr->invoke_fseek(fd, std::get<2>(res));
}
Expand Down

0 comments on commit 7fa267b

Please sign in to comment.