mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-19 09:00:54 +00:00
kernel: hosted: print pid of a process that exited
Signed-off-by: Sean Cross <sean@xobs.io>
This commit is contained in:
parent
39c9ef30b7
commit
5f6b42d534
1 changed files with 5 additions and 5 deletions
|
|
@ -85,13 +85,13 @@ fn handle_connection(
|
||||||
ServerPacketWithData([usize; 9], Vec<u8>),
|
ServerPacketWithData([usize; 9], Vec<u8>),
|
||||||
}
|
}
|
||||||
|
|
||||||
fn conn_thread(mut conn: TcpStream, sender: Sender<ServerMessage>) {
|
fn conn_thread(mut conn: TcpStream, sender: Sender<ServerMessage>, pid: PID) {
|
||||||
loop {
|
loop {
|
||||||
let mut raw_data = [0u8; 9 * std::mem::size_of::<usize>()];
|
let mut raw_data = [0u8; 9 * std::mem::size_of::<usize>()];
|
||||||
if let Err(_e) = conn.read_exact(&mut raw_data) {
|
if let Err(e) = conn.read_exact(&mut raw_data) {
|
||||||
println!(
|
println!(
|
||||||
"KERNEL(?): Client disconnected: {} ({:?}). Shutting down virtual process.",
|
"KERNEL({}): client disconnected: {} -- shutting down virtual process",
|
||||||
_e, _e
|
pid, e
|
||||||
);
|
);
|
||||||
sender.send(ServerMessage::Exit).ok();
|
sender.send(ServerMessage::Exit).ok();
|
||||||
return;
|
return;
|
||||||
|
|
@ -140,7 +140,7 @@ fn handle_connection(
|
||||||
std::thread::Builder::new()
|
std::thread::Builder::new()
|
||||||
.name(format!("PID {}: client connection thread", pid))
|
.name(format!("PID {}: client connection thread", pid))
|
||||||
.spawn(move || {
|
.spawn(move || {
|
||||||
conn_thread(conn, conn_sender);
|
conn_thread(conn, conn_sender, pid);
|
||||||
})
|
})
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue