2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-31 06:15:24 +00:00

Fix check for open_image() ret

When open_image() was modified to return a pointer rather than an int
in commit 295090c1, these two checks were overlooked and never fixed.

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Acked-by: Andrew Vagin <avagin@odin.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
Kir Kolyshkin
2015-05-01 02:25:00 +03:00
committed by Pavel Emelyanov
parent b17962ad8d
commit 8ac865f3ee
2 changed files with 2 additions and 2 deletions

View File

@@ -340,7 +340,7 @@ static int dump_ghost_file(int _fd, u32 id, const struct stat *st, dev_t phys_de
pr_info("Dumping ghost file contents (id %#x)\n", id);
img = open_image(CR_FD_GHOST_FILE, O_DUMP, id);
if (img < 0)
if (!img)
return -1;
gfe.uid = userns_uid(st->st_uid);

View File

@@ -2199,7 +2199,7 @@ static int collect_mnt_from_image(struct mount_info **pms, struct ns_id *nsid)
char root[PATH_MAX] = ".";
img = open_image(CR_FD_MNTS, O_RSTR, nsid->id);
if (img < 0)
if (!img)
return -1;
if (nsid->id != root_item->ids->mnt_ns_id)