aboutsummaryrefslogtreecommitdiff
path: root/fontconfig/src/fcatomic.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-05-29 09:06:20 +0200
committermarha <marha@users.sourceforge.net>2012-05-29 09:06:20 +0200
commit3558b1795c7fa3a87e9b74cd1dfedbb2ad438ae8 (patch)
tree4f945d98347a8e736e66af191c0ada59a6ad0a81 /fontconfig/src/fcatomic.c
parente514bce90660eb2ec76f50af13866f84da93ec60 (diff)
parentce592e25d6303a8f4a8aa0e2918e0f72a35bf175 (diff)
downloadvcxsrv-3558b1795c7fa3a87e9b74cd1dfedbb2ad438ae8.tar.gz
vcxsrv-3558b1795c7fa3a87e9b74cd1dfedbb2ad438ae8.tar.bz2
vcxsrv-3558b1795c7fa3a87e9b74cd1dfedbb2ad438ae8.zip
Merge remote-tracking branch 'origin/released'
Conflicts: pixman/pixman/pixman-mmx.c xorg-server/Xext/hashtable.c
Diffstat (limited to 'fontconfig/src/fcatomic.c')
-rw-r--r--fontconfig/src/fcatomic.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/fontconfig/src/fcatomic.c b/fontconfig/src/fcatomic.c
index b5f3d5aaa..96f01235f 100644
--- a/fontconfig/src/fcatomic.c
+++ b/fontconfig/src/fcatomic.c
@@ -131,6 +131,13 @@ FcAtomicLock (FcAtomic *atomic)
return FcFalse;
}
ret = link ((char *) atomic->tmp, (char *) atomic->lck);
+ if (ret < 0 && errno == EPERM)
+ {
+ /* the filesystem where atomic->lck points to may not supports
+ * the hard link. so better try to fallback
+ */
+ ret = mkdir ((char *) atomic->lck, 0600);
+ }
(void) unlink ((char *) atomic->tmp);
#else
ret = mkdir ((char *) atomic->lck, 0600);
@@ -196,7 +203,8 @@ void
FcAtomicUnlock (FcAtomic *atomic)
{
#ifdef HAVE_LINK
- unlink ((char *) atomic->lck);
+ if (unlink ((char *) atomic->lck) == -1)
+ rmdir ((char *) atomic->lck);
#else
rmdir ((char *) atomic->lck);
#endif