aboutsummaryrefslogtreecommitdiff
path: root/fontconfig/src
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-06-18 08:30:48 +0200
committermarha <marha@users.sourceforge.net>2012-06-18 08:30:48 +0200
commitc264407352572f07e31695637d3d78d07ae0bae8 (patch)
treecf44f0d28a474db43950161c02bba835285ba383 /fontconfig/src
parent369603df0452765724d3b53cd77a9f4bf3809fa1 (diff)
parenta3691edaff553b5130c97ff912ecaa96f08a6643 (diff)
downloadvcxsrv-c264407352572f07e31695637d3d78d07ae0bae8.tar.gz
vcxsrv-c264407352572f07e31695637d3d78d07ae0bae8.tar.bz2
vcxsrv-c264407352572f07e31695637d3d78d07ae0bae8.zip
Merge remote-tracking branch 'origin/released'
Diffstat (limited to 'fontconfig/src')
-rw-r--r--fontconfig/src/fcatomic.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/fontconfig/src/fcatomic.c b/fontconfig/src/fcatomic.c
index 557dbc970..f15e02f23 100644
--- a/fontconfig/src/fcatomic.c
+++ b/fontconfig/src/fcatomic.c
@@ -106,6 +106,7 @@ FcAtomicLock (FcAtomic *atomic)
#ifdef HAVE_LINK
int fd = -1;
FILE *f = 0;
+ FcBool no_link = FcFalse;
strcpy ((char *) atomic->tmp, (char *) atomic->file);
strcat ((char *) atomic->tmp, TMP_NAME);
@@ -138,6 +139,7 @@ FcAtomicLock (FcAtomic *atomic)
* the hard link. so better try to fallback
*/
ret = mkdir ((char *) atomic->lck, 0600);
+ no_link = FcTrue;
}
(void) unlink ((char *) atomic->tmp);
#else
@@ -157,8 +159,16 @@ FcAtomicLock (FcAtomic *atomic)
if ((long int) (now - lck_stat.st_mtime) > 10 * 60)
{
#ifdef HAVE_LINK
- if (unlink ((char *) atomic->lck) == 0)
- return FcAtomicLock (atomic);
+ if (no_link)
+ {
+ if (rmdir ((char *) atomic->lck) == 0)
+ return FcAtomicLock (atomic);
+ }
+ else
+ {
+ if (unlink ((char *) atomic->lck) == 0)
+ return FcAtomicLock (atomic);
+ }
#else
if (rmdir ((char *) atomic->lck) == 0)
return FcAtomicLock (atomic);