> On Sep 12, 2016, at 04:33, Julien Cristau <[email protected]> wrote: > > On Sun, Sep 11, 2016 at 20:01:50 -0700, Jeremy Huddleston Sequoia wrote: > >> Signed-off-by: Jeremy Huddleston Sequoia <[email protected]> >> --- >> Xext/shm.c | 6 +++++- >> 1 file changed, 5 insertions(+), 1 deletion(-) >> > Does anything have O_TMPFILE but not O_CLOEXEC?
Not sure, but I figured it'd be good to be on the safe side. Snow Leopard (OS
X 10.6) doesn't have either. I saw this when making the change to check for
O_CLOEXEC in os/inputthread and thought I'd bring it up for consideration.
If you don't think that O_TMPFILE && !O_CLOEXEC is something we'll see in the
wild, I'm happy to just leave it as is.
--Jeremy
> Cheers,
> Julien
>
>> diff --git a/Xext/shm.c b/Xext/shm.c
>> index 125000f..7a45dbd 100644
>> --- a/Xext/shm.c
>> +++ b/Xext/shm.c
>> @@ -1202,7 +1202,11 @@ shm_tmpfile(void)
>> int flags;
>> char template[] = SHMDIR "/shmfd-XXXXXX";
>> #ifdef O_TMPFILE
>> - fd = open(SHMDIR, O_TMPFILE|O_RDWR|O_CLOEXEC|O_EXCL, 0666);
>> + flags = O_TMPFILE|O_RDWR|O_EXCL;
>> +#ifdef O_CLOEXEC
>> + flags |= O_CLOEXEC;
>> +#endif
>> + fd = open(SHMDIR, flags, 0666);
>> if (fd >= 0) {
>> ErrorF ("Using O_TMPFILE\n");
>> return fd;
>> --
>> 2.10.0 (Apple Git-99)
>>
>> _______________________________________________
>> [email protected]: X.Org development
>> Archives: http://lists.x.org/archives/xorg-devel
>> Info: https://lists.x.org/mailman/listinfo/xorg-devel
> _______________________________________________
> [email protected]: X.Org development
> Archives: http://lists.x.org/archives/xorg-devel
> Info: https://lists.x.org/mailman/listinfo/xorg-devel
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________ [email protected]: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: https://lists.x.org/mailman/listinfo/xorg-devel
