seize: Adjust the position of the log message

Based on the code, the `ret` variable at this point does not
represent the task state, so this log message should be
moved to a position after the `compel_wait_task()` function.

Signed-off-by: Yuanhong Peng <yummypeng@linux.alibaba.com>
This commit is contained in:
Yuanhong Peng 2024-12-19 14:30:41 +08:00 committed by Andrei Vagin
parent 97398068b1
commit 6fdac50818

View file

@ -707,8 +707,6 @@ static int collect_children(struct pstree_item *item)
goto free;
}
pr_info("Seized task %d, state %d\n", pid, ret);
c = alloc_pstree_item();
if (c == NULL) {
ret = -1;
@ -746,6 +744,8 @@ static int collect_children(struct pstree_item *item)
if (ret == TASK_STOPPED)
c->pid->stop_signo = compel_parse_stop_signo(pid);
pr_info("Seized task %d, state %d\n", pid, ret);
c->pid->real = pid;
c->parent = item;
c->pid->state = ret;