aboutsummaryrefslogtreecommitdiff
path: root/fontconfig/src/fccache.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2014-06-08 15:05:49 +0200
committermarha <marha@users.sourceforge.net>2014-06-08 15:05:49 +0200
commit71cc8d9b7dc729934a29445cbd6d1f7a6d9ecbec (patch)
treeea689cdd51f395980ddc37dc33781635976f3a16 /fontconfig/src/fccache.c
parentaec798fb4dc72d616732d0fa711faffaa8cd7590 (diff)
parent2acb86c9b086bdb9a3897db0b93820652e07cb59 (diff)
downloadvcxsrv-71cc8d9b7dc729934a29445cbd6d1f7a6d9ecbec.tar.gz
vcxsrv-71cc8d9b7dc729934a29445cbd6d1f7a6d9ecbec.tar.bz2
vcxsrv-71cc8d9b7dc729934a29445cbd6d1f7a6d9ecbec.zip
Merge remote-tracking branch 'origin/released'
Conflicts: apps/xwininfo/xwininfo.c xorg-server/hw/xwin/glx/indirect.c
Diffstat (limited to 'fontconfig/src/fccache.c')
-rw-r--r--fontconfig/src/fccache.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/fontconfig/src/fccache.c b/fontconfig/src/fccache.c
index 5173e0be2..085bd72e3 100644
--- a/fontconfig/src/fccache.c
+++ b/fontconfig/src/fccache.c
@@ -545,6 +545,26 @@ FcCacheTimeValid (FcCache *cache, struct stat *dir_stat)
return cache->checksum == (int) dir_stat->st_mtime;
}
+static FcBool
+FcCacheDirsValid (FcCache *cache)
+{
+ FcStrSet *dirs = FcStrSetCreate ();
+ FcBool ret = FcFalse;
+
+ if (!dirs)
+ goto bail;
+ if (!FcDirScanOnly (dirs, FcCacheDir (cache)))
+ goto bail1;
+ ret = cache->dirs_count == dirs->num;
+ if (FcDebug () & FC_DBG_CACHE)
+ printf ("%s: cache: %d, fs: %d\n", FcCacheDir (cache), cache->dirs_count, dirs->num);
+
+bail1:
+ FcStrSetDestroy (dirs);
+bail:
+ return ret;
+}
+
/*
* Map a cache file into memory
*/
@@ -559,7 +579,8 @@ FcDirCacheMapFd (int fd, struct stat *fd_stat, struct stat *dir_stat)
cache = FcCacheFindByStat (fd_stat);
if (cache)
{
- if (FcCacheTimeValid (cache, dir_stat))
+ if (FcCacheTimeValid (cache, dir_stat) &&
+ FcCacheDirsValid (cache))
return cache;
FcDirCacheUnload (cache);
cache = NULL;
@@ -611,6 +632,7 @@ FcDirCacheMapFd (int fd, struct stat *fd_stat, struct stat *dir_stat)
cache->version < FC_CACHE_CONTENT_VERSION ||
cache->size != (intptr_t) fd_stat->st_size ||
!FcCacheTimeValid (cache, dir_stat) ||
+ !FcCacheDirsValid (cache) ||
!FcCacheInsert (cache, fd_stat))
{
if (allocated)