Commit a839cc45 authored by Pavel Emelyanov's avatar Pavel Emelyanov

restore: Move other task-args preparations from sigreturn_restore

Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
Reviewed-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
parent 315008f9
...@@ -477,6 +477,9 @@ static int prepare_proc_misc(pid_t pid, TaskCoreEntry *tc) ...@@ -477,6 +477,9 @@ static int prepare_proc_misc(pid_t pid, TaskCoreEntry *tc)
return 0; 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) static int restore_one_alive_task(int pid, CoreEntry *core)
{ {
unsigned args_len; unsigned args_len;
...@@ -551,6 +554,12 @@ static int restore_one_alive_task(int pid, CoreEntry *core) ...@@ -551,6 +554,12 @@ static int restore_one_alive_task(int pid, CoreEntry *core)
if (seccomp_filters_get_rst_pos(core, ta) < 0) if (seccomp_filters_get_rst_pos(core, ta) < 0)
return -1; 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); return sigreturn_restore(pid, ta_cp, core);
} }
...@@ -2031,7 +2040,7 @@ out: ...@@ -2031,7 +2040,7 @@ out:
return ret; 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; int ret = 0;
TaskTimersEntry *tte = core->tc->timers; TaskTimersEntry *tte = core->tc->timers;
...@@ -2932,14 +2941,6 @@ static int sigreturn_restore(pid_t pid, unsigned long ta_cp, CoreEntry *core) ...@@ -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); 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 */ /* No longer need it */
core_entry__free_unpacked(core, NULL); core_entry__free_unpacked(core, NULL);
xfree(current->core); xfree(current->core);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment