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

Function launch

tests/test_coverage_parent_failure.c:199–214  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

197}
198
199static bool launch(Fixture *f) {
200 if (restricted_requested) {
201 struct rlimit limited = f->saved, observed;
202 limited.rlim_cur = 0;
203 f->parent_restore_pending = true;
204 if (setrlimit(RLIMIT_NOFILE, &limited) != 0 || getrlimit(RLIMIT_NOFILE, &observed) != 0 ||
205 !same_limit(&limited, &observed))
206 return false;
207 }
208 f->pid = fork();
209 if (f->pid == 0)
210 child_run(f);
211 /* Restore before closing handles, formatting paths, or inspecting the child. */
212 bool restored = restore_parent(f);
213 return restored && f->pid > 0 && close_fd(&f->ack[1]) && close_fd(&f->gate[0]);
214}
215
216static bool reap(Fixture *f, bool terminate) {
217 if (f->pid < 0 || f->reaped)

Callers 1

fixtureFunction · 0.70

Calls 4

same_limitFunction · 0.85
child_runFunction · 0.85
restore_parentFunction · 0.85
close_fdFunction · 0.70

Tested by

no test coverage detected