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

Function finish_child

tests/test_coverage_children.c:274–292  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

272}
273
274static bool finish_child(Child *child, int *status, bool *reaped) {
275 if (child->operation == SETUP_KILL) {
276 if (!reap(child, true, status, reaped))
277 return false;
278 } else {
279 if (!send_byte(child->gate[1], 'G') || !held_protocol(child) ||
280 !reap(child, false, status, reaped))
281 return false;
282 }
283 bool expected = child->operation == SETUP_KILL
284 ? WIFSIGNALED(*status) && WTERMSIG(*status) == SIGKILL
285 : WIFEXITED(*status) && WEXITSTATUS(*status) == 0;
286 if (!expected || (child->obstruct && !remove_obstruction(child)))
287 return false;
288 int final = marker_present(child);
289 return final >= 0 &&
290 note(child, "reaped", final,
291 WIFSIGNALED(*status) ? 128 + WTERMSIG(*status) : WEXITSTATUS(*status));
292}
293
294static int run_child(const char *stem, const char *id, enum ChildOperation operation,
295 bool obstruct) {

Callers 1

run_childFunction · 0.85

Calls 6

send_byteFunction · 0.85
held_protocolFunction · 0.85
remove_obstructionFunction · 0.85
reapFunction · 0.70
marker_presentFunction · 0.70
noteFunction · 0.70

Tested by

no test coverage detected