| 6 | |
| 7 | #ifndef _WIN32 |
| 8 | static void |
| 9 | wait_for_child_exit(int pid) { |
| 10 | int status; |
| 11 | while (true) { |
| 12 | if (waitpid(pid, &status, 0) == -1) { |
| 13 | test_fail("Unexpected waitpid() failure."); |
| 14 | } |
| 15 | if (WIFSIGNALED(status)) { |
| 16 | test_fail("Unexpected child termination due to " |
| 17 | "signal %d", WTERMSIG(status)); |
| 18 | break; |
| 19 | } |
| 20 | if (WIFEXITED(status)) { |
| 21 | if (WEXITSTATUS(status) != 0) { |
| 22 | test_fail("Unexpected child exit value %d", |
| 23 | WEXITSTATUS(status)); |
| 24 | } |
| 25 | break; |
| 26 | } |
| 27 | } |
| 28 | } |
| 29 | #endif |
| 30 | |
| 31 | TEST_BEGIN(test_fork) { |
no test coverage detected