Bug 82358 - FcAtomicLock fails on OS X on network mounts
Summary: FcAtomicLock fails on OS X on network mounts
Status: RESOLVED FIXED
Alias: None
Product: fontconfig
Classification: Unclassified
Component: library (show other bugs)
Version: 2.11
Hardware: x86-64 (AMD64) Mac OS X (All)
: medium normal
Assignee: fontconfig-bugs
QA Contact: Behdad Esfahbod
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-08-08 16:59 UTC by michael-lists
Modified: 2016-05-18 20:55 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments

Description michael-lists 2014-08-08 16:59:58 UTC
On OS X systems (in my case, OS X 10.9.4), if the cache folder is on a mounted network share (e.g. because the user's home directory is on an SMB or AFP server), running fc-cache will fail to write to ~/.cache/fontconfig. This means the lengthy caching process is performed every time fontconfig is used.

The issue can be fixed by applying the patch below as evidently, OS X returns ENOTSUP when link() is performed on a file system that does not support hardlinks instead of EPERM.

The issue occurs in fontconfig 2.10 and 2.11, possibly older ones as well.

--- src/fcatomic.c.orig	2012-05-28 15:58:56.000000000 +0900
+++ src/fcatomic.c	2014-08-07 11:47:45.000000000 +0200
@@ -131,7 +131,7 @@ FcAtomicLock (FcAtomic *atomic)
        return FcFalse;
     }
     ret = link ((char *) atomic->tmp, (char *) atomic->lck);
-    if (ret < 0 && errno == EPERM)
+    if (ret < 0 && (errno == EPERM || errno == ENOTSUP))
     {
        /* the filesystem where atomic->lck points to may not supports
         * the hard link. so better try to fallback
Comment 1 Akira TAGOH 2014-08-11 03:16:25 UTC
fixed in git.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.