diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/igt_core.c | 4 | ||||
-rw-r--r-- | lib/igt_core.h | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/lib/igt_core.c b/lib/igt_core.c index 56061c3a..92a875c6 100644 --- a/lib/igt_core.c +++ b/lib/igt_core.c @@ -1882,6 +1882,10 @@ FILE *__igt_fopen_data(const char* igt_srcdir, const char* igt_datadir, snprintf(path, sizeof(path), "%s/%s", igt_srcdir, filename); fp = fopen(path, "r"); } + if (!fp) { + snprintf(path, sizeof(path), "./%s", filename); + fp = fopen(path, "r"); + } if (!fp) igt_critical("Could not open data file \"%s\": %s", filename, diff --git a/lib/igt_core.h b/lib/igt_core.h index 1b62371a..59952331 100644 --- a/lib/igt_core.h +++ b/lib/igt_core.h @@ -842,8 +842,8 @@ FILE *__igt_fopen_data(const char* igt_srcdir, const char* igt_datadir, * igt_fopen_data: * @filename: filename to open. * - * Open a datafile for test, first try from installation directory - * then from build directory. + * Open a datafile for test, first try from installation directory, + * then from build directory, and finally from current directory. */ #define igt_fopen_data(filename) \ __igt_fopen_data(IGT_SRCDIR, IGT_DATADIR, filename) |