diff options
Diffstat (limited to 'x11/libxshmfence/files/patch-src__xshmfence_alloc.c')
-rw-r--r-- | x11/libxshmfence/files/patch-src__xshmfence_alloc.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/x11/libxshmfence/files/patch-src__xshmfence_alloc.c b/x11/libxshmfence/files/patch-src__xshmfence_alloc.c index 682232029c9a..ea14877817ec 100644 --- a/x11/libxshmfence/files/patch-src__xshmfence_alloc.c +++ b/x11/libxshmfence/files/patch-src__xshmfence_alloc.c @@ -1,19 +1,24 @@ ---- 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 @@ +--- src/xshmfence_alloc.c.orig 2015-03-04 15:28:23 UTC ++++ src/xshmfence_alloc.c +@@ -67,15 +67,19 @@ int xshmfence_alloc_shm(void) { char template[] = SHMDIR "/shmfd-XXXXXX"; - int fd; + int fd = -1; + #if HAVE_MEMFD_CREATE + fd = memfd_create("xshmfence", MFD_CLOEXEC|MFD_ALLOW_SEALING); + if (fd < 0) + #endif + { -#ifdef O_TMPFILE +#if defined(O_CLOEXEC) +#if defined(HAVE_MKOSTEMP) -+ fd = mkostemp(template, O_CLOEXEC); ++ fd = mkostemp(template, O_CLOEXEC); +#elif defined(O_TMPFILE) - fd = open(SHMDIR, O_TMPFILE|O_RDWR|O_CLOEXEC|O_EXCL, 0666); + fd = open(SHMDIR, O_TMPFILE|O_RDWR|O_CLOEXEC|O_EXCL, 0666); +#endif - if (fd < 0) + if (fd < 0) #endif - { + { |