...otherwise you get a less helpful error message.
Coverity-ID:
1055569
Signed-off-by: Matthew Daley <mattjd@gmail.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
} else {
restore_source = restore_file;
restore_fd = open(restore_file, O_RDONLY);
+ if (restore_fd == -1) {
+ fprintf(stderr, "Can't open restore file: %s\n", strerror(errno));
+ return ERROR_INVAL;
+ }
rc = libxl_fd_set_cloexec(ctx, restore_fd, 1);
if (rc) return rc;
}