diff --git a/cr-dump.c b/cr-dump.c index 9fd4f2cdf..576b71fe8 100644 --- a/cr-dump.c +++ b/cr-dump.c @@ -1151,7 +1151,7 @@ static int dump_pstree(pid_t pid, const struct list_head *pstree_list) pr_info("Dumping pstree (pid: %d)\n", pid); pr_info("----------------------------------------\n"); - pstree_fd = open_image(CR_FD_PSTREE, O_RDWR | O_CREAT | O_EXCL, pid); + pstree_fd = open_image(CR_FD_PSTREE, O_RDWR | O_CREAT | O_EXCL); if (pstree_fd < 0) return -1; diff --git a/cr-restore.c b/cr-restore.c index 3c29fcca6..a3a32228a 100644 --- a/cr-restore.c +++ b/cr-restore.c @@ -1167,7 +1167,7 @@ static int restore_task_with_children(void *_arg) pr_info("%d: Starting restore\n", me->pid); - fd = open_image_ro_nocheck(FMT_FNAME_PSTREE, pstree_pid); + fd = open_image_ro_nocheck(FMT_FNAME_PSTREE); if (fd < 0) { pr_perror("%d: Can't reopen pstree image", me->pid); exit(1); @@ -1291,7 +1291,7 @@ static int restore_all_tasks(pid_t pid, struct cr_options *opts) int pstree_fd = -1; u32 type = 0; - pstree_fd = open_image_ro(CR_FD_PSTREE, pstree_pid); + pstree_fd = open_image_ro(CR_FD_PSTREE); if (pstree_fd < 0) return -1; diff --git a/cr-show.c b/cr-show.c index 8b83599bc..860bbed30 100644 --- a/cr-show.c +++ b/cr-show.c @@ -561,16 +561,20 @@ static int cr_show_all(unsigned long pid, struct cr_options *opts) struct cr_fdset *cr_fdset = NULL; struct pstree_item *item = NULL; LIST_HEAD(pstree_list); - int i, ret = -1; + int i, ret = -1, pstree_fd; - cr_fdset = cr_show_fdset_open(pid, CR_FD_DESC_PSTREE | CR_FD_DESC_SK_QUEUES); - if (!cr_fdset) + pstree_fd = open_image_ro(CR_FD_PSTREE); + if (pstree_fd) goto out; - ret = show_pstree(cr_fdset->fds[CR_FD_PSTREE], &pstree_list); + ret = show_pstree(pstree_fd, &pstree_list); if (ret) goto out; + cr_fdset = cr_show_fdset_open(pid, CR_FD_DESC_SK_QUEUES); + if (!cr_fdset) + goto out; + ret = show_sk_queues(cr_fdset->fds[CR_FD_SK_QUEUES]); if (ret) goto out; diff --git a/include/crtools.h b/include/crtools.h index 50535c94c..f797c1528 100644 --- a/include/crtools.h +++ b/include/crtools.h @@ -83,7 +83,7 @@ extern struct cr_fd_desc_tmpl fdset_template[CR_FD_MAX]; #define FMT_FNAME_CORE "core-%d.img" #define FMT_FNAME_VMAS "vmas-%d.img" #define FMT_FNAME_PIPES "pipes-%d.img" -#define FMT_FNAME_PSTREE "pstree-%d.img" +#define FMT_FNAME_PSTREE "pstree.img" #define FMT_FNAME_SIGACTS "sigacts-%d.img" #define FMT_FNAME_UNIXSK "unixsk-%d.img" #define FMT_FNAME_INETSK "inetsk-%d.img"