+2006-02-16 Patrick Lam <plam@mit.edu>
+ * src/fccache.c (FcDirCacheHasCurrentArch):
+
+ Deal correctly with changing FC_CACHE_MAGIC.
+
2006-02-16 Patrick Lam <plam@mit.edu>
* fc-cache/fc-cache.c (usage, scanDirs, main):
int fd;
off_t current_arch_start;
char *current_arch_machine_name;
+ FcCache metadata;
fd = FcDirCacheOpen (dir);
if (fd < 0)
current_arch_machine_name = FcCacheMachineSignature();
current_arch_start = FcCacheSkipToArch(fd, current_arch_machine_name);
+
+ if (current_arch_start >= 0)
+ {
+ if (read(fd, &metadata, sizeof(FcCache)) != sizeof(FcCache))
+ {
+ close (fd);
+ return FcFalse;
+ }
+
+ if (metadata.magic != FC_CACHE_MAGIC)
+ {
+ close (fd);
+ return FcFalse;
+ }
+ }
+
close (fd);
if (current_arch_start < 0)