2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-31 06:15:24 +00:00

restore: Move other task-args preparations from sigreturn_restore

Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Reviewed-by: Cyrill Gorcunov <gorcunov@openvz.org>
This commit is contained in:
Pavel Emelyanov
2016-05-24 14:37:01 +03:00
parent 315008f99a
commit a839cc45f8

View File

@@ -477,6 +477,9 @@ static int prepare_proc_misc(pid_t pid, TaskCoreEntry *tc)
return 0;
}
static int prepare_itimers(int pid, struct task_restore_args *args, CoreEntry *core);
static int prepare_mm(pid_t pid, struct task_restore_args *args);
static int restore_one_alive_task(int pid, CoreEntry *core)
{
unsigned args_len;
@@ -551,6 +554,12 @@ static int restore_one_alive_task(int pid, CoreEntry *core)
if (seccomp_filters_get_rst_pos(core, ta) < 0)
return -1;
if (prepare_itimers(pid, ta, core) < 0)
return -1;
if (prepare_mm(pid, ta))
return -1;
return sigreturn_restore(pid, ta_cp, core);
}
@@ -2031,7 +2040,7 @@ out:
return ret;
}
static int prepare_itimers(int pid, CoreEntry *core, struct task_restore_args *args)
static int prepare_itimers(int pid, struct task_restore_args *args, CoreEntry *core)
{
int ret = 0;
TaskTimersEntry *tte = core->tc->timers;
@@ -2932,14 +2941,6 @@ static int sigreturn_restore(pid_t pid, unsigned long ta_cp, CoreEntry *core)
new_sp = restorer_stack(task_args->t->mz);
ret = prepare_itimers(pid, core, task_args);
if (ret < 0)
goto err;
ret = prepare_mm(pid, task_args);
if (ret < 0)
goto err;
/* No longer need it */
core_entry__free_unpacked(core, NULL);
xfree(current->core);