]> git.wh0rd.org - fontconfig.git/blobdiff - src/fccache.c
Have FcConfigSetCurrent accept the current configuration and simply return
[fontconfig.git] / src / fccache.c
index c43609ccdd735f734fb2341cfbca813a8549dbbe..c24b06184a120a6571cee4e749473fc81e47fe34 100644 (file)
@@ -493,8 +493,8 @@ FcDirCacheMapFd (int fd, struct stat *fd_stat, struct stat *dir_stat)
     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);
@@ -559,7 +559,10 @@ FcDirCacheLoadFile (const FcChar8 *cache_file, struct stat *file_stat)
 {
     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;