From: Behdad Esfahbod Date: Wed, 4 Feb 2009 02:06:15 +0000 (-0500) Subject: [fccache] Make sure the cache is current when reusing from open caches X-Git-Tag: 2.7.0~103 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=6bb5d72fe788f897e30ab39ac7585c624282303f;p=fontconfig.git [fccache] Make sure the cache is current when reusing from open caches Reported by Diego Santa Cruz. --- diff --git a/src/fccache.c b/src/fccache.c index 53df860..f35304a 100644 --- a/src/fccache.c +++ b/src/fccache.c @@ -538,7 +538,13 @@ FcDirCacheMapFd (int fd, struct stat *fd_stat, struct stat *dir_stat) return NULL; cache = FcCacheFindByStat (fd_stat); if (cache) - return cache; + { + if (FcCacheTimeValid (cache, dir_stat)) + return cache; + FcDirCacheUnload (cache); + cache = NULL; + } + /* * Lage cache files are mmap'ed, smaller cache files are read. This * balances the system cost of mmap against per-process memory usage.