aboutsummaryrefslogtreecommitdiff
path: root/fontconfig/src/fcatomic.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-06-18 08:29:53 +0200
committermarha <marha@users.sourceforge.net>2012-06-18 08:29:53 +0200
commita3691edaff553b5130c97ff912ecaa96f08a6643 (patch)
tree8a1fb2257d45cc0ebd3d0a69fdf8a7a8a0cc9d1e /fontconfig/src/fcatomic.c
parenta33de30073bfa0ee1abba186dba9fa52cf0aa23a (diff)
downloadvcxsrv-a3691edaff553b5130c97ff912ecaa96f08a6643.tar.gz
vcxsrv-a3691edaff553b5130c97ff912ecaa96f08a6643.tar.bz2
vcxsrv-a3691edaff553b5130c97ff912ecaa96f08a6643.zip
fontconfig mesa pixman git update 18 Jun 2012
Diffstat (limited to 'fontconfig/src/fcatomic.c')
-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 bc7b07bd4..350744abb 100644
--- a/fontconfig/src/fcatomic.c
+++ b/fontconfig/src/fcatomic.c
@@ -105,6 +105,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);
@@ -137,6 +138,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
@@ -156,8 +158,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);