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,14 +403,19 @@ static int read_pstree_image(void) ...@@ -403,14 +403,19 @@ static int read_pstree_image(void)
pstree_entry__free_unpacked(e, NULL); pstree_entry__free_unpacked(e, NULL);
fd = open_image(CR_FD_IDS, O_RSTR, pi->pid.virt); {
if (fd < 0) { int fd;
if (errno == ENOENT)
continue; fd = open_image(CR_FD_IDS, O_RSTR, pi->pid.virt);
goto err; if (fd < 0) {
if (errno == ENOENT)
continue;
goto err;
}
ret = pb_read_one(fd, &pi->ids, PB_IDS);
close(fd);
} }
ret = pb_read_one(fd, &pi->ids, PB_IDS);
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