]> git.wh0rd.org - fontconfig.git/commitdiff
Allow font caches to contain newer version numbers
authorKeith Packard <keithp@neko.keithp.com>
Sat, 2 Sep 2006 21:54:14 +0000 (14:54 -0700)
committerKeith Packard <keithp@neko.keithp.com>
Sat, 2 Sep 2006 21:54:14 +0000 (14:54 -0700)
Use the version number inside the cache file to mark backward compatible
changes while continuing to reserve the filename number for incompatible
changes.

src/fccache.c

index af2c68fa88ebcd3348db24f9b270fc985edd7c5a..05dc7eee6ad2f40d48e26eacb1f7ea4441cf002a 100644 (file)
@@ -231,7 +231,7 @@ FcDirCacheMapFd (int fd, off_t size)
        allocated = FcTrue;
     } 
     if (cache->magic != FC_CACHE_MAGIC_MMAP || 
-       cache->version != FC_CACHE_CONTENT_VERSION ||
+       cache->version < FC_CACHE_CONTENT_VERSION ||
        cache->size != size)
     {
        if (allocated)
@@ -323,7 +323,7 @@ FcDirCacheValidateHelper (int fd, off_t size, void *closure)
        ret = FcFalse;
     else if (c.magic != FC_CACHE_MAGIC_MMAP)
        ret = FcFalse;
-    else if (c.version != FC_CACHE_CONTENT_VERSION)
+    else if (c.version < FC_CACHE_CONTENT_VERSION)
        ret = FcFalse;
     else if (fstat (fd, &file_stat) < 0)
        ret = FcFalse;