X-Git-Url: https://git.wh0rd.org/?a=blobdiff_plain;f=src%2Ffccache.c;h=646f03af8dacb42e9b1275288f630a6bb7265212;hb=76abb77f26c43d069919f80e960c71c2242fb5c2;hp=1411766fadcfec7e60c51ce1e875eb98fdb615af;hpb=2d3387fd720f33f80847ae6cbb83d94c9a52fde3;p=fontconfig.git diff --git a/src/fccache.c b/src/fccache.c index 1411766..646f03a 100644 --- a/src/fccache.c +++ b/src/fccache.c @@ -242,7 +242,7 @@ FcDirCacheProcess (FcConfig *config, const FcChar8 *dir, } static FcBool -FcDirCacheLoad (int fd, off_t size, void *closure) +FcCacheLoad (int fd, off_t size, void *closure) { FcCache *cache; FcBool allocated = FcFalse; @@ -303,13 +303,15 @@ FcDirCacheLoad (int fd, off_t size, void *closure) } FcCache * -FcDirCacheMap (int fd, off_t size) +FcDirCacheMap (const FcChar8 *dir, FcConfig *config) { - FcCache *cache; + FcCache *cache = NULL; - if (FcDirCacheLoad (fd, size, &cache)) - return cache; - return NULL; + if (!FcDirCacheProcess (config, dir, + FcCacheLoad, + &cache)) + return NULL; + return cache; } FcBool @@ -322,9 +324,8 @@ FcDirCacheRead (FcFontSet * set, FcStrSet * dirs, intptr_t *cache_dirs; FcPattern **cache_fonts; - if (!FcDirCacheProcess (config, dir, - FcDirCacheLoad, - &cache)) + cache = FcDirCacheMap (dir, config); + if (!cache) return FcFalse; cache_set = FcCacheSet (cache);