diff options
author | Masamichi Hosoda <trueroad@trueroad.jp> | 2017-01-11 20:42:56 +0900 |
---|---|---|
committer | Akira TAGOH <akira@tagoh.org> | 2017-06-01 11:46:07 +0900 |
commit | 79058f4e911487275323e93146e1e93ad15afcd8 (patch) | |
tree | cce18c3c350e1b60bbb0f506732a6ded9f06954b | |
parent | 7d949ececdff18a1718eba6b7cb9f63f84486a10 (diff) | |
download | fontconfig-79058f4e911487275323e93146e1e93ad15afcd8.tar.gz |
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.
-rw-r--r-- | src/fcdir.c | 8 |
1 files changed, 8 insertions, 0 deletions
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) |