fontconfig: don't use link(2) for locking

This commit is contained in:
Leonid Pliushch 2018-10-03 02:34:05 +03:00 committed by Fredrik Fornwall
parent 28ff552523
commit 123549819d
2 changed files with 21 additions and 0 deletions

View File

@ -1,6 +1,7 @@
TERMUX_PKG_HOMEPAGE=https://www.freedesktop.org/wiki/Software/fontconfig/
TERMUX_PKG_DESCRIPTION="Library for configuring and customizing font access"
TERMUX_PKG_VERSION=2.13.1
TERMUX_PKG_REVISION=1
TERMUX_PKG_SHA256=f655dd2a986d7aa97e052261b36aa67b0a64989496361eca8d604e6414006741
TERMUX_PKG_SRCURL=https://www.freedesktop.org/software/fontconfig/release/fontconfig-${TERMUX_PKG_VERSION}.tar.bz2
TERMUX_PKG_DEPENDS="freetype, libxml2, libpng, libuuid"

View File

@ -0,0 +1,20 @@
diff -uNr fontconfig-2.13.1/src/fcatomic.c fontconfig-2.13.1.mod/src/fcatomic.c
--- fontconfig-2.13.1/src/fcatomic.c 2018-03-15 10:44:44.000000000 +0200
+++ fontconfig-2.13.1.mod/src/fcatomic.c 2018-10-03 02:20:37.073426762 +0300
@@ -130,15 +130,12 @@
unlink ((char *) atomic->tmp);
return FcFalse;
}
- ret = link ((char *) atomic->tmp, (char *) atomic->lck);
- if (ret < 0 && (errno == EPERM || errno == ENOTSUP || errno == EACCES))
- {
+
/* the filesystem where atomic->lck points to may not supports
* the hard link. so better try to fallback
*/
ret = mkdir ((char *) atomic->lck, 0600);
no_link = FcTrue;
- }
(void) unlink ((char *) atomic->tmp);
#else
ret = mkdir ((char *) atomic->lck, 0600);