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

Function bootstrap_enospc_reap

tests/test_daemon_bootstrap.c:969–986  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

967}
968
969static void bootstrap_enospc_reap(bootstrap_enospc_host_t *state, int *nonzero_exits) {
970 *nonzero_exits = 0;
971 for (size_t i = 0; i < state->child_count; i++) {
972 int status = state->exit_status[i];
973 if (!state->reaped[i]) {
974 /* Only reachable when the synchronous wait in the spawn itself
975 * failed; never leave a host behind. */
976 pid_t waited;
977 (void)kill(state->children[i], SIGKILL);
978 do {
979 waited = waitpid(state->children[i], &status, 0);
980 } while (waited < 0 && errno == EINTR);
981 }
982 if (!WIFEXITED(status) || WEXITSTATUS(status) != 0) {
983 (*nonzero_exits)++;
984 }
985 }
986}
987
988static bool bootstrap_read_file(const char *path, char *out, size_t capacity) {
989 FILE *file = cbm_fopen(path, "rb");

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected