From 6fb3759c5f755a06a3d543328973340f56a1bea8 Mon Sep 17 00:00:00 2001 From: Andrey Vagin Date: Mon, 2 Jul 2012 15:25:00 +0400 Subject: [PATCH] restore: restore pgid in two phases As described in the previous patch, process group leaders are restored in the first phase, then all other processes restores pgid. Signed-off-by: Andrey Vagin Signed-off-by: Pavel Emelyanov --- cr-restore.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cr-restore.c b/cr-restore.c index 2c36f40ab..a3f142b42 100644 --- a/cr-restore.c +++ b/cr-restore.c @@ -705,10 +705,14 @@ static int restore_task_with_children(void *_arg) exit(1); } + if (me->pgid == me->pid.virt) + restore_pgid(); + futex_dec_and_wake(&task_entries->nr_in_progress); futex_wait_while(&task_entries->start, CR_STATE_FORKING); - restore_pgid(); + if (me->pgid != me->pid.virt) + restore_pgid(); if (me->state != TASK_HELPER) { futex_dec_and_wake(&task_entries->nr_in_progress);