From 6bb5d72fe788f897e30ab39ac7585c624282303f Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 3 Feb 2009 21:06:15 -0500 Subject: [PATCH] [fccache] Make sure the cache is current when reusing from open caches Reported by Diego Santa Cruz. --- src/fccache.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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. -- 2.39.5