Skip to content

Commit

Permalink
remove leading underscores from execvp and exit
Browse files Browse the repository at this point in the history
  • Loading branch information
xmclark committed Mar 6, 2019
1 parent 84c8be6 commit b1739d9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions lib/emscripten/src/exec.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use libc::execvp;
use libc::execvp as libc_execvp;
use std::cell::Cell;
use std::ffi::CString;
use wasmer_runtime_core::vm::Ctx;

pub fn _execvp(ctx: &mut Ctx, command_name_offset: u32, argv_offset: u32) -> i32 {
pub fn execvp(ctx: &mut Ctx, command_name_offset: u32, argv_offset: u32) -> i32 {
// a single reference to re-use
let emscripten_memory = ctx.memory(0);

Expand Down Expand Up @@ -36,5 +36,5 @@ pub fn _execvp(ctx: &mut Ctx, command_name_offset: u32, argv_offset: u32) -> i32
// construct raw pointers and hand them to `execvp`
let command_pointer = command_name_string.as_ptr() as *const i8;
let args_pointer = argv.as_ptr();
unsafe { execvp(command_pointer, args_pointer) }
unsafe { libc_execvp(command_pointer, args_pointer) }
}
4 changes: 2 additions & 2 deletions lib/emscripten/src/exit.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use wasmer_runtime_core::vm::Ctx;

// __exit
pub fn __exit(_ctx: &mut Ctx, value: i32) {
debug!("emscripten::__exit {}", value);
pub fn exit(_ctx: &mut Ctx, value: i32) {
debug!("emscripten::exit {}", value);
::std::process::exit(value);
}
4 changes: 2 additions & 2 deletions lib/emscripten/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -442,10 +442,10 @@ pub fn generate_emscripten_env(globals: &mut EmscriptenGlobals) -> ImportObject
"___wait" => func!(crate::lock::___wait),

// exec
"_execvp" => func!(crate::exec::_execvp),
"_execvp" => func!(crate::exec::execvp),

// exit
"__exit" => func!(crate::exit::__exit),
"__exit" => func!(crate::exit::exit),

// Env
"___assert_fail" => func!(crate::env::___assert_fail),
Expand Down

0 comments on commit b1739d9

Please sign in to comment.