if (cache->magic != FC_CACHE_MAGIC_MMAP ||
cache->version < FC_CACHE_CONTENT_VERSION ||
cache->size != fd_stat->st_size ||
- !FcCacheInsert (cache, fd_stat) ||
- !FcCacheTimeValid (cache, dir_stat))
+ !FcCacheTimeValid (cache, dir_stat) ||
+ !FcCacheInsert (cache, fd_stat))
{
if (allocated)
free (cache);
{
int fd;
FcCache *cache;
+ struct stat my_file_stat;
+ if (!file_stat)
+ file_stat = &my_file_stat;
fd = FcDirCacheOpenFile (cache_file, file_stat);
if (fd < 0)
return NULL;