MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / wait_pid_gone

Function wait_pid_gone

tests/test_subprocess.c:306–317  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

304}
305
306static bool wait_pid_gone(pid_t pid, int timeout_ms) {
307 uint64_t deadline = cbm_now_ms() + (uint64_t)timeout_ms;
308 do {
309 errno = 0;
310 if (kill(pid, 0) < 0 && errno == ESRCH) {
311 return true;
312 }
313 subprocess_test_pause();
314 } while (cbm_now_ms() < deadline);
315 errno = 0;
316 return kill(pid, 0) < 0 && errno == ESRCH;
317}
318
319/* Best-effort cleanup for a failing implementation, so a red tree test does not
320 * leave its TERM-ignoring probes behind for later tests. The production API must

Callers 1

test_subprocess.cFile · 0.85

Calls 2

cbm_now_msFunction · 0.85
subprocess_test_pauseFunction · 0.85

Tested by

no test coverage detected