From 2482c5a24b520a178eac5841a9ab23b8a4ef89d2 Mon Sep 17 00:00:00 2001 From: Pavel Emelyanov Date: Tue, 4 Dec 2012 17:12:37 +0300 Subject: [PATCH] rst: Move initial nr_in_progress initialization It's better to init it closer to the rest of rst orchestration. Signed-off-by: Pavel Emelyanov --- cr-restore.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cr-restore.c b/cr-restore.c index 997f1f39e..ff6543ace 100644 --- a/cr-restore.c +++ b/cr-restore.c @@ -1132,6 +1132,7 @@ static int restore_root_task(struct pstree_item *init, struct cr_options *opts) return -1; } + futex_set(&task_entries->nr_in_progress, task_entries->nr_tasks + task_entries->nr_helpers); ret = fork_with_pid(init, opts->namespaces_flags); if (ret < 0) @@ -1230,8 +1231,6 @@ int cr_restore_tasks(pid_t pid, struct cr_options *opts) if (crtools_prepare_shared() < 0) return -1; - futex_set(&task_entries->nr_in_progress, task_entries->nr_tasks + task_entries->nr_helpers); - return restore_root_task(root_item, opts); }