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. */
| 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. */ |
| 1731 | static 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. */ |
no test coverage detected