[CRIU] [RFC PATCHv2 20/32] zdtm: static/file_locks00: report pass/fail in parent process

Ivan Shapovalov intelfx at intelfx.name
Sat Mar 12 00:42:19 PST 2016


Signed-off-by: Ivan Shapovalov <intelfx at intelfx.name>
---
 test/zdtm/static/file_locks00.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/test/zdtm/static/file_locks00.c b/test/zdtm/static/file_locks00.c
index f3ea60f..16576f6 100644
--- a/test/zdtm/static/file_locks00.c
+++ b/test/zdtm/static/file_locks00.c
@@ -164,7 +164,6 @@ int main(int argc, char **argv)
 			exit(1);
 		}
 
-		pass();
 		exit(0);
 	}
 
@@ -175,7 +174,15 @@ int main(int argc, char **argv)
 	test_waitsig();
 
 	kill(pid, SIGTERM);
-	waitpid(pid, NULL, 0);
+
+	int r;
+	waitpid(pid, &r, 0);
+	if (WIFEXITED(r) && WEXITSTATUS(r) == 0) {
+		pass();
+	} else {
+		fail("child exited with %d", r);
+	}
+
 	close(fd_0);
 	close(fd_1);
 	unlink(file0);
-- 
2.7.2



More information about the CRIU mailing list