1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
From 79058f4e911487275323e93146e1e93ad15afcd8 Mon Sep 17 00:00:00 2001
From: Masamichi Hosoda <trueroad@trueroad.jp>
Date: Wed, 11 Jan 2017 20:42:56 +0900
Subject: Bug 99360 - Fix cache file update on MinGW
On Windows, opened or locked files cannot be removed.
Since fontconfig locked an old cache file while updating the file,
fontconfig failed to replace the file with updated file on Windows.
This patch makes fontconfig does not lock the old cache file
while updating it on Windows.
diff --git a/src/fcdir.c b/src/fcdir.c
index fd62a34..c8aaf54 100644
--- a/src/fcdir.c
+++ b/src/fcdir.c
@@ -362,7 +362,9 @@ FcDirCacheScan (const FcChar8 *dir, FcConfig *config)
if (!dirs)
goto bail1;
+#ifndef _WIN32
fd = FcDirCacheLock (dir, config);
+#endif
/*
* Scan the dir
*/
@@ -382,7 +384,9 @@ FcDirCacheScan (const FcChar8 *dir, FcConfig *config)
FcDirCacheWrite (cache, config);
bail2:
+#ifndef _WIN32
FcDirCacheUnlock (fd);
+#endif
FcStrSetDestroy (dirs);
bail1:
FcFontSetDestroy (set);
@@ -417,7 +421,9 @@ FcDirCacheRescan (const FcChar8 *dir, FcConfig *config)
if (!dirs)
goto bail;
+#ifndef _WIN32
fd = FcDirCacheLock (dir, config);
+#endif
/*
* Scan the dir
*/
@@ -436,7 +442,9 @@ FcDirCacheRescan (const FcChar8 *dir, FcConfig *config)
FcDirCacheWrite (new, config);
bail1:
+#ifndef _WIN32
FcDirCacheUnlock (fd);
+#endif
FcStrSetDestroy (dirs);
bail:
if (d)
--
cgit v0.10.2
|