MCPcopy Create free account
hub / github.com/ScriptedAlchemy/tracedecay / kill_child_process_tree

Function kill_child_process_tree

src/sessions/codex_app_server.rs:263–278  ·  view source on GitHub ↗
(child: &mut Child)

Source from the content-addressed store, hash-verified

261
262#[cfg(windows)]
263fn kill_child_process_tree(child: &mut Child) {
264 // `cmd /C` shims wait for their grandchildren, so a child that already
265 // exited has no live process tree left; skip the taskkill spawn that
266 // would fail anyway.
267 if matches!(child.try_wait(), Ok(Some(_))) {
268 return;
269 }
270 let _ = Command::new("taskkill")
271 .arg("/PID")
272 .arg(child.id().to_string())
273 .arg("/T")
274 .arg("/F")
275 .stdout(Stdio::null())
276 .stderr(Stdio::null())
277 .status();
278}
279
280#[cfg(not(windows))]
281fn kill_child_process_tree(_child: &mut Child) {}

Callers 1

dropMethod · 0.85

Calls 2

statusMethod · 0.80
idMethod · 0.45

Tested by

no test coverage detected