mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2025-06-10 01:16:18 +00:00
lib: use a critical warning when unable to open a data file
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
This commit is contained in:
parent
8b3082a40e
commit
90dadcd0da
@ -1751,5 +1751,10 @@ FILE *__igt_fopen_data(const char* igt_srcdir, const char* igt_datadir,
|
|||||||
snprintf(path, sizeof(path), "%s/%s", igt_srcdir, filename);
|
snprintf(path, sizeof(path), "%s/%s", igt_srcdir, filename);
|
||||||
fp = fopen(path, "r");
|
fp = fopen(path, "r");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!fp)
|
||||||
|
igt_critical("Could not open data file \"%s\": %s", filename,
|
||||||
|
strerror(errno));
|
||||||
|
|
||||||
return fp;
|
return fp;
|
||||||
}
|
}
|
||||||
|
@ -262,11 +262,8 @@ static void paint_image(cairo_t *cr, const char *file)
|
|||||||
img_x = (width / 2) - (img_w / 2);
|
img_x = (width / 2) - (img_w / 2);
|
||||||
|
|
||||||
fp = igt_fopen_data(file);
|
fp = igt_fopen_data(file);
|
||||||
if (!fp) {
|
if (!fp)
|
||||||
igt_warn("data file \'%s\' missing: %s\n",
|
|
||||||
file, strerror(errno));
|
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
image = cairo_image_surface_create_from_png_stream(&stdio_read_func,
|
image = cairo_image_surface_create_from_png_stream(&stdio_read_func,
|
||||||
(void*)fp);
|
(void*)fp);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user