diff --git a/files-reg.c b/files-reg.c index d7251ec30..2a6269b2a 100644 --- a/files-reg.c +++ b/files-reg.c @@ -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); diff --git a/mount.c b/mount.c index a78a48326..6dc48ebcd 100644 --- a/mount.c +++ b/mount.c @@ -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)