[CRIU] [PATCH 1/2] restore: Open cores earlier

Cyrill Gorcunov gorcunov at openvz.org
Fri Aug 5 10:55:40 PDT 2016


We will need task credentials on the hand when
we're restoring tty peers, so open cores early.

Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
 criu/cr-restore.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/criu/cr-restore.c b/criu/cr-restore.c
index 6c83d7f11313..49cfb6bbd3e1 100644
--- a/criu/cr-restore.c
+++ b/criu/cr-restore.c
@@ -650,6 +650,9 @@ static int restore_one_alive_task(int pid, CoreEntry *core)
 
 	memzero(ta, args_len);
 
+	if (open_cores(pid, core))
+		return -1;
+
 	if (prepare_fds(current))
 		return -1;
 
@@ -665,9 +668,6 @@ static int restore_one_alive_task(int pid, CoreEntry *core)
 	if (fixup_sysv_shmems())
 		return -1;
 
-	if (open_cores(pid, core))
-		return -1;
-
 	if (prepare_signals(pid, ta, core))
 		return -1;
 
-- 
2.7.4



More information about the CRIU mailing list