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 <nicolai.haehnle@amd.com>
This commit is contained in:
Timothy Arceri
2017-02-21 16:34:49 +11:00
parent 207e3a6e4b
commit 0441e6bc8b
2 changed files with 48 additions and 2 deletions

View File

@@ -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) {