2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-29 05:18:00 +00:00

dump: Add comment why get_task_regs for task is in such a strange place

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
Pavel Emelyanov 2013-07-16 20:30:55 +04:00
parent d20089fb32
commit c2dec75bbd

View File

@ -959,6 +959,12 @@ static int parasite_start_daemon(struct parasite_ctl *ctl, struct pstree_item *i
{
pid_t pid = ctl->pid.real;
/*
* Get task registers before going daemon, since the
* get_task_regs needs to call ptrace on _stopped_ task,
* while in daemon it is not such.
*/
if (get_task_regs(pid, ctl->regs_orig, item->core[0])) {
pr_err("Can't obtain regs for thread %d\n", pid);
return -1;