bunpen: preserve environment across exec boundary
This commit is contained in:
@@ -16,7 +16,7 @@ fn do_exec(path: str, args: []str) (os::exec::error | void) = {
|
||||
log::printfln("exec ({}): {}", path, joined);
|
||||
};
|
||||
|
||||
rtext::check_error("exec", rtext::execve(path, args));
|
||||
rtext::check_error("exec", rtext::execve(path, args, os::getenvs()));
|
||||
|
||||
// XXX: os::exec::exec offers no way to preserve argv0, but it does
|
||||
// work if you don't care about that:
|
||||
|
@@ -12,8 +12,7 @@ export fn execve(path: str, argv: []str, envp: []str = []) (rt::errno | void) =
|
||||
make_cstr(&path_buf, path): uintptr: u64,
|
||||
// XXX: this "leaks" the c arrays, but not much can be done about that
|
||||
to_cstr_array(argv): *[*]nullable *const c::char: uintptr: u64,
|
||||
0,
|
||||
// to_cstr_array(envp): *[*]nullable *const c::char: uintptr: u64,
|
||||
to_cstr_array(envp): *[*]nullable *const c::char: uintptr: u64,
|
||||
)?;
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user