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 <xemul@parallels.com>
This commit is contained in:
Pavel Emelyanov 2012-12-04 17:12:37 +03:00
parent 70af6cdd62
commit 2482c5a24b

View file

@ -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);
}