2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-31 14:25:49 +00:00

dump: Sanitize pstree dumping

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
Pavel Emelyanov
2012-03-22 20:51:47 +04:00
parent 3e8e358d82
commit 1b5c403241

View File

@@ -1159,21 +1159,13 @@ static int dump_pstree(pid_t pid, const struct list_head *pstree_list)
if (write_img(pstree_fd, &e))
goto err;
pr_info("Children:");
for (i = 0; i < item->nr_children; i++) {
pr_info(" %d", item->children[i]);
if (write_img(pstree_fd, &item->children[i]))
goto err;
}
pr_info("\n");
if (write_img_buf(pstree_fd, item->children,
item->nr_children * sizeof(u32)))
goto err;
pr_info("Threads:\n");
for (i = 0; i < item->nr_threads; i++) {
pr_info(" %d", item->threads[i]);
if (write_img(pstree_fd, &item->threads[i]))
goto err;
}
pr_info("\n");
if (write_img_buf(pstree_fd, item->threads,
item->nr_threads * sizeof(u32)))
goto err;
}
ret = 0;