radv: Handle failing to create .cache dir.
authorBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Sat, 23 May 2020 00:26:04 +0000 (02:26 +0200)
committerMarge Bot <eric+marge@anholt.net>
Mon, 25 May 2020 11:12:07 +0000 (11:12 +0000)
Fixes: f4e499ec791 "radv: add initial non-conformant radv vulkan driver"
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5181>

src/amd/vulkan/radv_meta.c

index 0acffbc5ccd0dce09e1e3d9710dbc7230d7eb0a7..6d2f24d148f3a9de267f15569e1bd36d8435b6c4 100644 (file)
@@ -262,7 +262,8 @@ radv_builtin_cache_path(char *path)
 
        strcpy(path, pwd.pw_dir);
        strcat(path, "/.cache");
 
        strcpy(path, pwd.pw_dir);
        strcat(path, "/.cache");
-       mkdir(path, 0755);
+       if (mkdir(path, 0755))
+               return false;
 
        ret = snprintf(path, PATH_MAX + 1, "%s%s%zd",
                       pwd.pw_dir, suffix2, sizeof(void *) * 8);
 
        ret = snprintf(path, PATH_MAX + 1, "%s%s%zd",
                       pwd.pw_dir, suffix2, sizeof(void *) * 8);