Commit d5bee200 authored by Tycho Andersen's avatar Tycho Andersen Committed by Pavel Emelyanov

tests: only wait for the pid we spawned

In the next patch, we'll introduce an option to allow for leaving zombie
processes in the pid ns for the test so that we can test the behavior of
zombies. Let's not reap everything after restore, since we'll reap the
restored zombies as well.

v2: restore the old behavior when in reap mode

CC: Andrey Vagin <avagin@openvz.org>
Signed-off-by: 's avatarTycho Andersen <tycho.andersen@canonical.com>
Acked-by: 's avatarAndrew Vagin <avagin@virtuozzo.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
parent b3c42b28
......@@ -343,8 +343,13 @@ int ns_init(int argc, char **argv)
kill(pid, SIGTERM);
ret = 0;
while (ret != -1)
ret = wait(NULL);
if (reap) {
while (ret != -1)
ret = wait(NULL);
} else {
waitpid(pid, NULL, 0);
}
exit(1);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment