[Teton] Duplicate yellowstone cap before spawning processes.
This commit is contained in:
parent
ebe72af716
commit
961389dee8
|
@ -68,9 +68,14 @@ void Terminal::ExecuteCommand(const glcr::String& command) {
|
||||||
}
|
}
|
||||||
auto file = mmth::File::Open(tokens[1]);
|
auto file = mmth::File::Open(tokens[1]);
|
||||||
|
|
||||||
// TODO: Wait until the process exits.
|
z_cap_t endpoint;
|
||||||
auto error_or_cap = mmth::SpawnProcessFromElfRegion(
|
if (ZCapDuplicate(gInitEndpointCap, kZionPerm_All, &endpoint) != glcr::OK) {
|
||||||
(uint64_t)file.raw_ptr(), gInitEndpointCap);
|
console_.WriteString("Couldn't duplicate yellowstone cap for spawn");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
auto error_or_cap =
|
||||||
|
mmth::SpawnProcessFromElfRegion((uint64_t)file.raw_ptr(), endpoint);
|
||||||
if (!error_or_cap.ok()) {
|
if (!error_or_cap.ok()) {
|
||||||
console_.WriteString(
|
console_.WriteString(
|
||||||
glcr::StrFormat("Error: {}\n", error_or_cap.error()));
|
glcr::StrFormat("Error: {}\n", error_or_cap.error()));
|
||||||
|
|
Loading…
Reference in New Issue