Commit 0c5dc93b authored by Pavel Emelyanov's avatar Pavel Emelyanov

Subject: [PATCH 07/14] pstree: Subblock for ids read on task restore

Ugly, but it's for easier further patching.
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
Acked-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
parent 35be2ee2
...@@ -318,7 +318,7 @@ static int prepare_pstree_for_shell_job(void) ...@@ -318,7 +318,7 @@ static int prepare_pstree_for_shell_job(void)
static int read_pstree_image(void) static int read_pstree_image(void)
{ {
int ret = 0, i, ps_fd, fd; int ret = 0, i, ps_fd;
struct pstree_item *pi, *parent = NULL; struct pstree_item *pi, *parent = NULL;
pr_info("Reading image tree\n"); pr_info("Reading image tree\n");
...@@ -403,6 +403,9 @@ static int read_pstree_image(void) ...@@ -403,6 +403,9 @@ static int read_pstree_image(void)
pstree_entry__free_unpacked(e, NULL); pstree_entry__free_unpacked(e, NULL);
{
int fd;
fd = open_image(CR_FD_IDS, O_RSTR, pi->pid.virt); fd = open_image(CR_FD_IDS, O_RSTR, pi->pid.virt);
if (fd < 0) { if (fd < 0) {
if (errno == ENOENT) if (errno == ENOENT)
...@@ -411,6 +414,8 @@ static int read_pstree_image(void) ...@@ -411,6 +414,8 @@ static int read_pstree_image(void)
} }
ret = pb_read_one(fd, &pi->ids, PB_IDS); ret = pb_read_one(fd, &pi->ids, PB_IDS);
close(fd); close(fd);
}
if (ret != 1) if (ret != 1)
goto err; goto err;
......
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