Commit d1b96437 authored by Andrey Vagin's avatar Andrey Vagin Committed by Pavel Emelyanov

dump: avoid extra jumps dump_one_task

It looks better and the next patches adds more checks
before memory allocations.
Signed-off-by: 's avatarAndrey Vagin <avagin@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent e25d1152
......@@ -1338,15 +1338,15 @@ static int dump_one_task(struct pstree_item *item)
pr_info("Dumping task (pid: %d)\n", pid);
pr_info("========================================\n");
dfds = xmalloc(sizeof(*dfds));
if (!dfds)
goto err_free;
if (item->state == TASK_STOPPED) {
pr_err("Stopped tasks are not supported\n");
goto err_free;
return -1;
}
dfds = xmalloc(sizeof(*dfds));
if (!dfds)
goto err_free;
pr_info("Obtainting task stat ... ");
ret = parse_pid_stat(pid, &pps_buf);
if (ret < 0)
......
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