From 514510ba873e5c0ce6bda6eba01353031a1ac006 Mon Sep 17 00:00:00 2001 From: Andrei Vagin Date: Thu, 30 Nov 2017 01:55:36 +0300 Subject: [PATCH] zdtm/tempfs_subns: sync children with the main process All static tests has to stop any activity before C/R. ./tempfs_subns --pidfile=tempfs_subns.pid --outfile=tempfs_subns.out --dirname=tempfs_subns.test Run criu dump Unable to kill 128: [Errno 3] No such process Run criu restore 7: Old mounts lost: [] 7: New mounts appeared: [('/rootfs/criu/test', '/'), ('/', '/proc'), ('/', '/dev/pts')] : Signed-off-by: Andrei Vagin --- test/zdtm/static/tempfs_subns.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/zdtm/static/tempfs_subns.c b/test/zdtm/static/tempfs_subns.c index 42195b57c..610f427d7 100644 --- a/test/zdtm/static/tempfs_subns.c +++ b/test/zdtm/static/tempfs_subns.c @@ -42,26 +42,26 @@ int main(int argc, char **argv) pid = fork(); if (pid == 0) { - if (write(fds[1], &fd, sizeof(fd)) != sizeof(fd)) { - pr_perror("write"); - return 1; - } if (unshare(CLONE_NEWNS)) { pr_perror("unshare"); return 1; } prctl(PR_SET_PDEATHSIG, SIGKILL, 0, 0, 0); + if (write(fds[1], &fd, sizeof(fd)) != sizeof(fd)) { + pr_perror("write"); + return 1; + } while (1) sleep(1); return 1; } pid = fork(); if (pid == 0) { + prctl(PR_SET_PDEATHSIG, SIGKILL, 0, 0, 0); if (write(fds[1], &fd, sizeof(fd)) != sizeof(fd)) { pr_perror("write"); return 1; } - prctl(PR_SET_PDEATHSIG, SIGKILL, 0, 0, 0); while (1) sleep(1); return 1;