aboutsummaryrefslogtreecommitdiffstats
path: root/x11
diff options
context:
space:
mode:
authorjkim <jkim@FreeBSD.org>2014-07-09 05:06:40 +0800
committerjkim <jkim@FreeBSD.org>2014-07-09 05:06:40 +0800
commit5ac27d5fc0223f4b15ff2f26902cf4fbfab51b4b (patch)
treeabf4fe99d779cdc5d28ebc7490c22e3d628a3486 /x11
parent82262574530c673903388fc4605ee58edb78e729 (diff)
downloadfreebsd-ports-gnome-5ac27d5fc0223f4b15ff2f26902cf4fbfab51b4b.tar.gz
freebsd-ports-gnome-5ac27d5fc0223f4b15ff2f26902cf4fbfab51b4b.tar.zst
freebsd-ports-gnome-5ac27d5fc0223f4b15ff2f26902cf4fbfab51b4b.zip
Fix xshmfence_alloc_shm() on 8.3 and 9.x. O_CLOEXEC is available on all
supported versions but mkostemp(3) is only available from 10.0. Therfore, the fd was not properly initialized on them.
Diffstat (limited to 'x11')
-rw-r--r--x11/libxshmfence/Makefile2
-rw-r--r--x11/libxshmfence/files/patch-src__xshmfence_alloc.c19
2 files changed, 10 insertions, 11 deletions
diff --git a/x11/libxshmfence/Makefile b/x11/libxshmfence/Makefile
index c6c3e1705f9e..bcbb547b0c99 100644
--- a/x11/libxshmfence/Makefile
+++ b/x11/libxshmfence/Makefile
@@ -2,7 +2,7 @@
PORTNAME= libxshmfence
PORTVERSION= 1.1
-PORTREVISION= 2
+PORTREVISION= 3
CATEGORIES= x11
MAINTAINER= x11@FreeBSD.org
diff --git a/x11/libxshmfence/files/patch-src__xshmfence_alloc.c b/x11/libxshmfence/files/patch-src__xshmfence_alloc.c
index df38300fb2a8..682232029c9a 100644
--- a/x11/libxshmfence/files/patch-src__xshmfence_alloc.c
+++ b/x11/libxshmfence/files/patch-src__xshmfence_alloc.c
@@ -1,8 +1,11 @@
---- src/xshmfence_alloc.c 2013-11-20 17:13:08.000000000 -0500
-+++ src/xshmfence_alloc.c 2013-12-09 16:06:17.000000000 -0500
-@@ -41,11 +41,15 @@
+--- src/xshmfence_alloc.c.orig 2013-11-20 17:13:08.000000000 -0500
++++ src/xshmfence_alloc.c 2014-07-08 16:39:18.000000000 -0400
+@@ -39,10 +39,14 @@
+ xshmfence_alloc_shm(void)
+ {
char template[] = SHMDIR "/shmfd-XXXXXX";
- int fd;
+- int fd;
++ int fd = -1;
-#ifdef O_TMPFILE
+#if defined(O_CLOEXEC)
@@ -10,11 +13,7 @@
+ fd = mkostemp(template, O_CLOEXEC);
+#elif defined(O_TMPFILE)
fd = open(SHMDIR, O_TMPFILE|O_RDWR|O_CLOEXEC|O_EXCL, 0666);
-- if (fd < 0)
++#endif
+ if (fd < 0)
#endif
-+ if (fd < 0)
{
-+#endif
- fd = mkstemp(template);
- if (fd < 0)
- return fd;