kernel: fix v1 spawn bug

This commit is contained in:
hosted-fornet 2024-12-12 16:14:25 -08:00
parent 6106f7be78
commit 911f51dc70
2 changed files with 6 additions and 2 deletions

View File

@ -147,13 +147,14 @@ fn handle_request(
.iter()
.map(|cap| {
serde_json::from_str::<(ProcessId, String)>(cap).unwrap_or_else(|_| {
(cap.parse::<ProcessId>().unwrap(), "messaging".to_string())
(cap.parse::<ProcessId>().unwrap(), "\"messaging\"".to_string())
})
})
.collect(),
))
})
.unwrap_or((vec![], vec![]));
println!("tester: request_caps: {request_caps:?}\ntester: grant_caps: {grant_caps:?}");
request_caps.extend(our_capabilities());
let child_process_id = match spawn(
None,

View File

@ -754,7 +754,10 @@ impl StandardHost for process::ProcessWasiV1 {
.send(t::CapMessage::Add {
on: t::ProcessId::de_wit_v1(process_id),
caps: vec![t::Capability::new(
self.process.metadata.our.clone(),
(
self.process.metadata.our.node.clone(),
&new_process_id,
),
params,
)],
responder: Some(tx),