2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-31 14:25:49 +00:00

zdtm: pidns03: Wait till child dead

Wait child before daemonization to do not allow
zdtm.py to see child fds and maps before it
becomes zombie.

Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
This commit is contained in:
Andrei Vagin
2017-06-09 09:25:15 +03:00
parent 662ca6ba95
commit d8d3d8d81f

View File

@@ -113,6 +113,13 @@ static int child_fn(void)
goto err;
} else if (!pid)
exit(0);
ret = waitid(P_PID, pid, NULL, WEXITED|WNOWAIT);
if (ret) {
fail("Can't wait");
goto err;
}
futex_set_and_wake(futex, CHILD_PREPARED);
futex_wait_while_lt(futex, POST_RESTORE_CHECK);