From bd4e5d2f9db1d1b0a60944b22e02875680f40291 Mon Sep 17 00:00:00 2001 From: Andrey Vagin Date: Thu, 2 Aug 2012 16:08:06 +0400 Subject: [PATCH] restore: prepare shared objects after initializing namespaces On this stage crtools unlink old socket files, create ghost files and etc, so we should be in a correct namespace. Signed-off-by: Andrey Vagin Signed-off-by: Pavel Emelyanov --- cr-restore.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cr-restore.c b/cr-restore.c index 24a9ccd6f..2c8a1f3d4 100644 --- a/cr-restore.c +++ b/cr-restore.c @@ -708,6 +708,10 @@ static int restore_task_with_children(void *_arg) mount_proc(); } + if (me == root_item) + if (prepare_shared()) + exit(-1); + /* * The block mask will be restored in sigresturn. * @@ -890,9 +894,6 @@ int cr_restore_tasks(pid_t pid, struct cr_options *opts) if (prepare_pstree() < 0) return -1; - if (prepare_shared() < 0) - return -1; - if (prepare_pstree_ids() < 0) return -1;