summaryrefslogtreecommitdiffstats
path: root/src/util/disk_cache.c
diff options
context:
space:
mode:
authorTimothy Arceri <[email protected]>2017-02-21 16:34:49 +1100
committerTimothy Arceri <[email protected]>2017-02-22 08:40:14 +1100
commit0441e6bc8b377cf7a7b8441bca69121b98e30620 (patch)
tree55e375d4d9be01fc988d6710309585919b7953cc /src/util/disk_cache.c
parent207e3a6e4b6d70a965f2852204c35ccf42fe3533 (diff)
util/disk_cache: create timestamp and gpu_id dirs when MESA_GLSL_CACHE_DIR is used
The make check test is also updated to make sure these dirs are created. Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/util/disk_cache.c')
-rw-r--r--src/util/disk_cache.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/util/disk_cache.c b/src/util/disk_cache.c
index 6618a2471bc..2f138dab19b 100644
--- a/src/util/disk_cache.c
+++ b/src/util/disk_cache.c
@@ -225,8 +225,14 @@ disk_cache_create(const char *gpu_name, const char *timestamp)
* <pwd.pw_dir>/.cache/mesa
*/
path = getenv("MESA_GLSL_CACHE_DIR");
- if (path && mkdir_if_needed(path) == -1) {
- goto fail;
+ if (path) {
+ if (mkdir_if_needed(path) == -1)
+ goto fail;
+
+ path = create_mesa_cache_dir(local, path, timestamp,
+ gpu_name);
+ if (path == NULL)
+ goto fail;
}
if (path == NULL) {