patch for fccache.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Patch by Takashi Iwai <tiwai@xxxxxxx>:

--- src/fcint.h-dist	2006-01-31 19:45:08.000000000 +0100
+++ src/fcint.h	2006-01-31 19:45:21.000000000 +0100
@@ -335,6 +335,7 @@ struct _FcGlobalCacheDir {
     off_t			offset;
     FcStrSet			*subdirs;
     void			*ent;
+    unsigned int		updated;
 };
 
 typedef struct _FcGlobalCache {
--- src/fccache.c-dist	2006-01-31 19:28:33.000000000 +0100
+++ src/fccache.c	2006-01-31 19:43:34.000000000 +0100
@@ -284,6 +284,7 @@ FcGlobalCacheLoad (FcGlobalCache    *cac
 
 	d->name = (char *)FcStrCopy ((FcChar8 *)name_buf);
 	d->ent = 0;
+	d->updated = 0;
 
 	d->subdirs = FcStrSetCreate();
 	do
@@ -385,6 +386,14 @@ FcGlobalCacheUpdate (FcGlobalCache  *cac
 	    return FcFalse;
 	d->next = cache->dirs;
 	cache->dirs = d;
+    } else {
+	/* we have already the latest one */
+	if (d->updated)
+	    return FcTrue;
+	/* free old resources */
+	FcStrFree(d->name);
+	free(d->ent);
+	FcStrSetDestroy(d->subdirs);
     }
 
     cache->updated = FcTrue;
@@ -393,6 +402,7 @@ FcGlobalCacheUpdate (FcGlobalCache  *cac
     d->ent = FcDirCacheProduce (set, &d->metadata);
     d->offset = 0;
     d->subdirs = FcStrSetCreate();
+    d->updated = 1;
     for (i = 0; i < dirs->num; i++)
 	FcStrSetAdd (d->subdirs, dirs->strs[i]);
     return FcTrue;
-- 
Mike FABIAN   <mfabian@xxxxxxx>   http://www.suse.de/~mfabian
睡眠不足はいい仕事の敵だ。
_______________________________________________
Fontconfig mailing list
Fontconfig@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/fontconfig

[Index of Archives]     [Fedora Fonts]     [Fedora Users]     [Fedora Cloud]     [Kernel]     [Fedora Packaging]     [Fedora Desktop]     [PAM]     [Gimp Graphics Editor]     [Yosemite News]

  Powered by Linux