Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 27 May 2021 03:31:35 GMT
From:      Jan Beich <jbeich@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org
Subject:   git: f783260c1c4d - main - x11/libxshmfence: prefer SHM_ANON over mksotemp()
Message-ID:  <202105270331.14R3VZvY011530@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by jbeich:

URL: https://cgit.FreeBSD.org/ports/commit/?id=f783260c1c4d7bacbb6d36cab209eab28da49d4e

commit f783260c1c4d7bacbb6d36cab209eab28da49d4e
Author:     Jan Beich <jbeich@FreeBSD.org>
AuthorDate: 2019-08-03 21:14:43 +0000
Commit:     Jan Beich <jbeich@FreeBSD.org>
CommitDate: 2021-05-27 03:30:56 +0000

    x11/libxshmfence: prefer SHM_ANON over mksotemp()
    
    SHM_ANON is faster and more similar to memfd_create()
    
    PR:             239630
    Approved by:    jkim
---
 x11/libxshmfence/Makefile                           |  1 +
 x11/libxshmfence/files/patch-src__xshmfence_alloc.c | 12 +++++++++++-
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/x11/libxshmfence/Makefile b/x11/libxshmfence/Makefile
index f9b72e5372ca..e0cee43889d2 100644
--- a/x11/libxshmfence/Makefile
+++ b/x11/libxshmfence/Makefile
@@ -1,5 +1,6 @@
 PORTNAME=	libxshmfence
 PORTVERSION=	1.3
+PORTREVISION=	1
 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 e6e0df9a946e..b6e98334e981 100644
--- a/x11/libxshmfence/files/patch-src__xshmfence_alloc.c
+++ b/x11/libxshmfence/files/patch-src__xshmfence_alloc.c
@@ -1,6 +1,16 @@
 --- src/xshmfence_alloc.c.orig	2015-03-04 15:28:23 UTC
 +++ src/xshmfence_alloc.c
-@@ -79,7 +79,11 @@ xshmfence_alloc_shm(void)
+@@ -73,13 +73,21 @@ xshmfence_alloc_shm(void)
+ 	fd = memfd_create("xshmfence", MFD_CLOEXEC|MFD_ALLOW_SEALING);
+ 	if (fd < 0)
+ #endif
++#ifdef SHM_ANON
++	fd = shm_open(SHM_ANON, O_RDWR|O_CLOEXEC, 0600);
++	if (fd < 0)
++#endif
+ 	{
+ #ifdef O_TMPFILE
+ 		fd = open(SHMDIR, O_TMPFILE|O_RDWR|O_CLOEXEC|O_EXCL, 0666);
  		if (fd < 0)
  #endif
  		{



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202105270331.14R3VZvY011530>