From dba33c4399aebdb03a1d11b2bb99a17cb006ead0 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Mon, 7 Nov 2011 20:00:51 -0500 Subject: [PATCH] FcStat: export for people to use 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 --- fc-cache/fc-cache.c | 4 ++-- fontconfig/fontconfig.h | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/fc-cache/fc-cache.c b/fc-cache/fc-cache.c index 98039f7..64eb22a 100644 --- a/fc-cache/fc-cache.c +++ b/fc-cache/fc-cache.c @@ -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", diff --git a/fontconfig/fontconfig.h b/fontconfig/fontconfig.h index 254acc3..cba961d 100644 --- a/fontconfig/fontconfig.h +++ b/fontconfig/fontconfig.h @@ -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); -- 2.39.2