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

Function reap

tests/test_coverage_parent_failure.c:216–229  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

214}
215
216static bool reap(Fixture *f, bool terminate) {
217 if (f->pid < 0 || f->reaped)
218 return true;
219 bool ok = true;
220 if (terminate && kill(f->pid, SIGKILL) != 0 && errno != ESRCH)
221 ok = false;
222 pid_t result;
223 do {
224 result = waitpid(f->pid, &f->status, 0);
225 } while (result < 0 && errno == EINTR);
226 if (result == f->pid || (result < 0 && errno == ECHILD))
227 f->reaped = true;
228 return result == f->pid && ok;
229}
230
231static bool observe_and_release(Fixture *f, const char *root, const char *test) {
232 int n = snprintf(f->marker, sizeof(f->marker), "%s/%s/%s.%ld.forked", root, tf_current_suite,

Callers 2

observe_and_releaseFunction · 0.70
fixtureFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected