kernel: hosted: properly shut down process

This ensures a process with a server can be reused.

Signed-off-by: Sean Cross <sean@xobs.io>
This commit is contained in:
Sean Cross 2020-07-23 17:57:35 +08:00
parent 0c2eb002ec
commit cf992e9b09

View file

@ -257,6 +257,8 @@ impl Process {
if pid_idx >= process_table.table.len() {
panic!("attempted to destroy PID that exceeds table index: {}", pid);
}
let process = process_table.table[pid_idx].as_mut().unwrap();
process.conn.shutdown(std::net::Shutdown::Both).unwrap();
process_table.table[pid_idx] = None;
Ok(())
})