summaryrefslogtreecommitdiff
path: root/lib/igt_core.c
diff options
context:
space:
mode:
authorMatt Roper <matthew.d.roper@intel.com>2016-05-26 16:02:05 -0700
committerMarius Vlad <marius.c.vlad@intel.com>2016-05-27 12:40:30 +0300
commit303b380d728bc870c399ba46525854d323f894e7 (patch)
tree35c0fbe79d01647b6892a6dd1b182d6ea19bf82c /lib/igt_core.c
parent04b8f0e025d92b7b8f08a14c22ebe0686b9ba5ea (diff)
igt_core: Search "." as final fallback for igt_fopen_data()
Some validation teams seem to run tests out of source directories that have been nfs mounted or rsync'd to different locations on the target machine. This causes the igt_srcdir that the tests were built with to be invalid on the machine the tests get run on. Add the current directory as a final fallback for data file searches. Reference: https://bugs.freedesktop.org/show_bug.cgi?id=92248 Cc: Humberto Israel Perez Rodriguez <humberto.i.perez.rodriguez@intel.com> Signed-off-by: Matt Roper <matthew.d.roper@intel.com> Signed-off-by: Marius Vlad <marius.c.vlad@intel.com>
Diffstat (limited to 'lib/igt_core.c')
-rw-r--r--lib/igt_core.c4
1 files changed, 4 insertions, 0 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,