]> git.wh0rd.org - fontconfig.git/commitdiff
FcStat: export for people to use
authorMike Frysinger <vapier@gentoo.org>
Tue, 8 Nov 2011 01:00:51 +0000 (20:00 -0500)
committerMike Frysinger <vapier@gentoo.org>
Tue, 8 Nov 2011 01:10:36 +0000 (20:10 -0500)
The fc-cache code uses stat() directly, but we already have a FcStat
helper to workaround misc issues, so export it and convert fc-cache
over.  This will be even more important when we add --root support.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
fc-cache/fc-cache.c
fontconfig/fontconfig.h

index 98039f77ff778aaa1fd583bf5e066b42c195b0bf..64eb22a92eed61b0a3dd0937dd7816bbe7a57fd8 100644 (file)
@@ -154,7 +154,7 @@ scanDirs (FcStrList *list, FcConfig *config, FcBool force, FcBool really_force,
            continue;
        }
 
-       if (stat ((char *) dir, &statb) == -1)
+       if (FcStat (dir, &statb) == -1)
        {
            switch (errno) {
            case ENOENT:
@@ -304,7 +304,7 @@ cleanCacheDirectory (FcConfig *config, FcChar8 *dir, FcBool verbose)
        else
        {
            target_dir = FcCacheDir (cache);
-           if (stat ((char *) target_dir, &target_stat) < 0)
+           if (FcStat (target_dir, &target_stat) < 0)
            {
                if (verbose)
                    printf ("%s: %s: missing directory: %s \n",
index 254acc31079cd709d1e1cb24a82b8f1ccdccea2a..cba961dd127f51c26448650fde162f3e3074b92f 100644 (file)
@@ -307,6 +307,9 @@ FcBlanksIsMember (FcBlanks *b, FcChar32 ucs4);
 
 /* fccache.c */
 
+FcPublic int
+FcStat (const FcChar8 *file, struct stat *statb);
+
 FcPublic const FcChar8 *
 FcCacheDir(const FcCache *c);