[CRIU] [PATCH] zdtm/maps007: send SIGTERM to stop a child process

Andrew Vagin avagin at openvz.org
Wed Jun 3 08:28:44 PDT 2015


It's typo fix. SIGTERM generates code dump and it's a reason
why this test fails by timeout sometimes.

Signed-off-by: Andrew Vagin <avagin at openvz.org>
---
 test/zdtm/live/transition/maps007.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/test/zdtm/live/transition/maps007.c b/test/zdtm/live/transition/maps007.c
index b5afe1a..0b6dadb 100644
--- a/test/zdtm/live/transition/maps007.c
+++ b/test/zdtm/live/transition/maps007.c
@@ -131,8 +131,9 @@ int main(int argc, char **argv)
 			err("unexpected state");
 		futex_set_and_wake(&shm->stop, 2);
 		test_waitsig();
+		return 0;
 	} else {
-		int readable = 0;
+		int readable = 0, status = -1;
 
 		/* stop the child */
 		futex_set(&shm->stop, 1);
@@ -160,8 +161,12 @@ int main(int argc, char **argv)
 			}
 		}
 		test_msg("readable %d\n", readable);
-		kill(child, SIGTRAP);
-		wait(NULL);
+		kill(child, SIGTERM);
+		wait(&status);
+		if (status != 0) {
+			err("Non-zero exit code: %d", status);
+			goto err;
+		}
 		pass();
 	}
 
-- 
2.4.2



More information about the CRIU mailing list