Reap the host child, with no deadline: the release signal makes a healthy * child exit within seconds, and a wedged one is left to the harness's * per-suite ceiling (see CLI_SCOPE_TIMEOUT_MS). Returns the child's exit code, * or -1 when it did not exit normally. */
| 1761 | * per-suite ceiling (see CLI_SCOPE_TIMEOUT_MS). Returns the child's exit code, |
| 1762 | * or -1 when it did not exit normally. */ |
| 1763 | static int cli_scope_reap_host(pid_t host) { |
| 1764 | int status = 0; |
| 1765 | for (;;) { |
| 1766 | pid_t reaped = waitpid(host, &status, 0); |
| 1767 | if (reaped == host) { |
| 1768 | return WIFEXITED(status) ? WEXITSTATUS(status) : -1; |
| 1769 | } |
| 1770 | if (reaped < 0 && errno != EINTR) { |
| 1771 | return -1; |
| 1772 | } |
| 1773 | } |
| 1774 | } |
| 1775 | |
| 1776 | /* One IPC attempt's outcome for cli_scope_until_answered. */ |
| 1777 | typedef enum { |
no outgoing calls
no test coverage detected