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

Function sp_stdout_reap

tests/test_subprocess.c:1929–1939  ·  view source on GitHub ↗

The finite child normally exits immediately. On a RED path, cancel and drain * before destroying; never pass a live handle to destroy. */

Source from the content-addressed store, hash-verified

1927/* The finite child normally exits immediately. On a RED path, cancel and drain
1928 * before destroying; never pass a live handle to destroy. */
1929static bool sp_stdout_reap(cbm_subprocess_t *process, cbm_proc_result_t *result) {
1930 bool terminal = sp_stdout_poll_terminal(process, result, cbm_now_ms() + 10000U);
1931 bool cleaned = terminal;
1932 if (!cleaned) {
1933 (void)cbm_subprocess_request_cancel(process);
1934 cleaned = sp_stdout_poll_terminal(process, result, cbm_now_ms() + 4000U);
1935 }
1936 if (cleaned)
1937 cbm_subprocess_destroy(process);
1938 return terminal;
1939}
1940
1941TEST(subprocess_stdout_null_preserves_merged_log) {
1942 sp_stdout_fixture_t fx;

Callers 1

test_subprocess.cFile · 0.85

Calls 4

sp_stdout_poll_terminalFunction · 0.85
cbm_now_msFunction · 0.85
cbm_subprocess_destroyFunction · 0.85

Tested by

no test coverage detected