config: treat user and xdg config permission problems as errors
[gitweb.git] / builtin / config.c
index 8cd08da99122bc79025d2a78204d316f1b7ba478..b0394efac9b7c257723b2a63be362138fd636e0f 100644 (file)
@@ -396,8 +396,8 @@ int cmd_config(int argc, const char **argv, const char *prefix)
                         */
                        die("$HOME not set");
 
-               if (access(user_config, R_OK) &&
-                   xdg_config && !access(xdg_config, R_OK))
+               if (access_or_warn(user_config, R_OK) &&
+                   xdg_config && !access_or_warn(xdg_config, R_OK))
                        given_config_file = xdg_config;
                else
                        given_config_file = user_config;