[CRIU] [PATCH cr] cr-restore: exit if someone can not be restored

Andrey Vagin avagin at openvz.org
Tue Sep 25 06:37:47 EDT 2012


Forgot to handle an error path in a one place.

Signed-off-by: Andrey Vagin <avagin at openvz.org>
---
 cr-restore.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/cr-restore.c b/cr-restore.c
index 9f3de99..d40c66b 100644
--- a/cr-restore.c
+++ b/cr-restore.c
@@ -892,6 +892,8 @@ static int restore_root_task(struct pstree_item *init, struct cr_options *opts)
 	pr_info("Wait until all tasks are restored\n");
 	futex_wait_while_gt(&task_entries->nr_in_progress, 0);
 	ret = (int)futex_get(&task_entries->nr_in_progress);
+	if (ret < 0)
+		goto out;
 
 	futex_set_and_wake(&task_entries->nr_in_progress, task_entries->nr);
 	futex_set_and_wake(&task_entries->start, CR_STATE_RESTORE_SIGCHLD);
-- 
1.7.1



More information about the CRIU mailing list