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

Function cli_scope_wait_ready

tests/test_cli.c:1731–1743  ·  view source on GitHub ↗

Read the host child's one-byte readiness signal, with no deadline: the * answer is 'R', 'E', or EOF when the child is gone (see * CLI_SCOPE_TIMEOUT_MS). Returns the byte, or 0 on EOF or a read error. */

Source from the content-addressed store, hash-verified

1729 * answer is 'R', 'E', or EOF when the child is gone (see
1730 * CLI_SCOPE_TIMEOUT_MS). Returns the byte, or 0 on EOF or a read error. */
1731static char cli_scope_wait_ready(int fd) {
1732 for (;;) {
1733 char ready = 0;
1734 ssize_t got = read(fd, &ready, 1);
1735 if (got == 1) {
1736 return ready;
1737 }
1738 if (got < 0 && errno == EINTR) {
1739 continue;
1740 }
1741 return 0; /* EOF (child gone) or error */
1742 }
1743}
1744
1745/* Records which setup step failed and says so on stderr, so the caller's
1746 * ASSERT_TRUE(ready) is never a silent failure. Returns false. */

Callers 1

cli_scope_fixture_startFunction · 0.85

Calls 1

readFunction · 0.70

Tested by

no test coverage detected