[CRIU] [PATCH] zdtm: don't use sleep for synchronization in zombie00

Andrey Vagin avagin at openvz.org
Tue Feb 24 06:07:16 PST 2015


Signed-off-by: Andrey Vagin <avagin at openvz.org>
---
 test/zdtm/live/static/zombie00.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/test/zdtm/live/static/zombie00.c b/test/zdtm/live/static/zombie00.c
index 3ceac93..358f9a8 100644
--- a/test/zdtm/live/static/zombie00.c
+++ b/test/zdtm/live/static/zombie00.c
@@ -65,7 +65,13 @@ int main(int argc, char ** argv)
 	 * wait4 here :( Use sleep.
 	 */
 
-	sleep(1);
+	for (i = 0; i < NR_ZOMBIES; i++) {
+		siginfo_t siginfo;
+		if (waitid(P_PID, zombie[i].pid, &siginfo, WNOWAIT | WEXITED)) {
+			err("Unable to wait %d", zombie[i].pid);
+			exit(1);
+		}
+	}
 
 	test_daemon();
 	test_waitsig();
-- 
1.9.3



More information about the CRIU mailing list