MCPcopy Create free account
hub / github.com/F-Stack/f-stack / wait_for_child_exit

Function wait_for_child_exit

app/redis-6.2.6/deps/jemalloc/test/unit/fork.c:8–28  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6
7#ifndef _WIN32
8static void
9wait_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
31TEST_BEGIN(test_fork) {

Callers 2

fork.cFile · 0.85
do_fork_thdFunction · 0.85

Calls 1

test_failFunction · 0.85

Tested by

no test coverage detected