2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-30 05:48:05 +00:00

zdtm:mntns_open: wait when a child process opens descriptors

Reported-by: Mr Jenkins
Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
Andrew Vagin 2015-12-22 00:35:00 +03:00 committed by Pavel Emelyanov
parent 7edbcdac86
commit caeb8db5ce

View File

@ -58,6 +58,8 @@ static int get_mntid(int fd)
return mnt_id;
}
task_waiter_t t;
int ns_child(void *_arg)
{
struct ns_exec_args *args = _arg;
@ -65,6 +67,7 @@ int ns_child(void *_arg)
int id1, id2;
fd2 = open(fpath, O_RDWR);
task_waiter_complete(&t, 1);
test_waitsig();
id1 = get_mntid(args->fd);
@ -87,6 +90,8 @@ int main(int argc, char **argv)
test_init(argc, argv);
task_waiter_init(&t);
snprintf(fpath, sizeof(fpath), "%s/%s", dirname, MPTS_FILE);
if (mkdir(dirname, 0600) < 0) {
fail("Can't make zdtm_sys");
@ -109,10 +114,11 @@ int main(int argc, char **argv)
close(args.fd);
}
task_waiter_wait4(&t, 1);
test_daemon();
test_waitsig();
if (pid > 0) {
kill(pid, SIGTERM);
int status = 1;