Commit 23848903 authored by Keith Packard's avatar Keith Packard

Don't use X_OK bit when checking for writable directories (bug 12438)

Some mingw versions have broken X_OK checking; instead of trying to work
around this in a system-depedent manner, simply don't bother checking for
X_OK along with W_OK as such cases are expected to be mistakes, and not
sensible access control.
parent 2b0d3d8a
......@@ -264,7 +264,7 @@ cleanCacheDirectory (FcConfig *config, FcChar8 *dir, FcBool verbose)
fprintf (stderr, "%s: out of memory\n", dir);
return FcFalse;
}
if (access ((char *) dir, W_OK|X_OK) != 0)
if (access ((char *) dir, W_OK) != 0)
{
if (verbose)
printf ("%s: not cleaning %s cache directory\n", dir,
......
......@@ -727,7 +727,7 @@ FcMakeDirectory (const FcChar8 *dir)
parent = FcStrDirname (dir);
if (!parent)
return FcFalse;
if (access ((char *) parent, W_OK|X_OK) == 0)
if (access ((char *) parent, F_OK) == 0)
ret = mkdir ((char *) dir, 0777) == 0;
else if (access ((char *) parent, F_OK) == -1)
ret = FcMakeDirectory (parent) && (mkdir ((char *) dir, 0777) == 0);
......@@ -760,7 +760,7 @@ FcDirCacheWrite (FcCache *cache, FcConfig *config)
if (!list)
return FcFalse;
while ((test_dir = FcStrListNext (list))) {
if (access ((char *) test_dir, W_OK|X_OK) == 0)
if (access ((char *) test_dir, W_OK) == 0)
{
cache_dir = test_dir;
break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment