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

Function wait_pid_gone

tests/test_subprocess.c:267–278  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

265}
266
267static bool wait_pid_gone(pid_t pid, int timeout_ms) {
268 uint64_t deadline = cbm_now_ms() + (uint64_t)timeout_ms;
269 do {
270 errno = 0;
271 if (kill(pid, 0) < 0 && errno == ESRCH) {
272 return true;
273 }
274 subprocess_test_pause();
275 } while (cbm_now_ms() < deadline);
276 errno = 0;
277 return kill(pid, 0) < 0 && errno == ESRCH;
278}
279
280/* Best-effort cleanup for a failing implementation, so a red tree test does not
281 * 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