[fccache] Make sure the cache is current when reusing from open caches

Reported by Diego Santa Cruz.
This commit is contained in:
Behdad Esfahbod 2009-02-03 21:06:15 -05:00
parent f9feb587fa
commit 6bb5d72fe7
1 changed files with 7 additions and 1 deletions

View File

@ -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.