[CRIU] [PATCH 1/7] tests: only wait for the pid we spawned

Tycho Andersen tycho.andersen at canonical.com
Thu Jun 23 08:13:19 PDT 2016


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.

CC: Andrey Vagin <avagin at openvz.org>
Signed-off-by: Tycho Andersen <tycho.andersen at canonical.com>
---
 test/zdtm/lib/ns.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/test/zdtm/lib/ns.c b/test/zdtm/lib/ns.c
index b432f54..225fa2d 100644
--- a/test/zdtm/lib/ns.c
+++ b/test/zdtm/lib/ns.c
@@ -338,8 +338,7 @@ int ns_init(int argc, char **argv)
 		kill(pid, SIGTERM);
 
 	ret = 0;
-	while (ret != -1)
-		ret = wait(NULL);
+	waitpid(pid, NULL, 0);
 
 	exit(1);
 }
-- 
2.7.4



More information about the CRIU mailing list