Re: Trouble forcing rescanning of font dirs

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

 



"Diego Santa Cruz" <Diego.SantaCruz@xxxxxxxxxxxx> さんは書きました:

> Thus we try to force fontconfig to validate all its caches and we do
> this by doing something like
>
>  
>
> if ( ! FcConfigUptoDate (0) )
>
>         FcInitReinitialize ();
>
>  
>
> at appropriate times (i.e. just before reloading content).

I also think this is a bug, see 

https://bugzilla.novell.com/show_bug.cgi?id=438855#c23

Comment #24 of this bug has a patch which I attach here as well
for convenience.

The line

 if (dir_stat.st_mtime <= file_stat.st_mtime) {

was removed recently from fccache.c, I think this was probably removed
by accident and was a mistake.

-- 
Mike FABIAN   <mfabian@xxxxxxx>   http://www.suse.de/~mfabian
睡眠不足はいい仕事の敵だ。
I � Unicode

diff -rup fontconfig-2.6.0.orig//src/fccache.c fontconfig-2.6.0/src/fccache.c
--- fontconfig-2.6.0.orig//src/fccache.c	2007-11-14 01:36:41.000000000 +0100
+++ fontconfig-2.6.0/src/fccache.c	2008-11-07 17:08:46.000000000 +0100
@@ -254,6 +254,7 @@ FcDirCacheProcess (FcConfig *config, con
 	    break;
         fd = FcDirCacheOpenFile (cache_hashed, &file_stat);
         if (fd >= 0) {
+	  if (dir_stat.st_mtime <= file_stat.st_mtime) {
 	    ret = (*callback) (fd, &file_stat, &dir_stat, closure);
 	    close (fd);
 	    if (ret)
@@ -264,6 +265,8 @@ FcDirCacheProcess (FcConfig *config, con
 		    FcStrFree (cache_hashed);
 		break;
 	    }
+	  } else
+	    close (fd);
 	}
     	FcStrFree (cache_hashed);
     }
_______________________________________________
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