On Fri, Jul  7, 2017 at 16:31:48 +0200, Jan Beich wrote:

> 
> Signed-off-by: Jan Beich <jbe...@freebsd.org>
> ---
>  Xext/shm.c              | 9 +++++++--
>  configure.ac            | 2 +-
>  include/dix-config.h.in | 3 +++
>  3 files changed, 11 insertions(+), 3 deletions(-)
> 
> diff --git a/Xext/shm.c b/Xext/shm.c
> index 91ea90b14..6edeba6fb 100644
> --- a/Xext/shm.c
> +++ b/Xext/shm.c
> @@ -1199,7 +1199,6 @@ shm_tmpfile(void)
>  {
>  #ifdef SHMDIR
>       int     fd;
> -     int     flags;
>       char    template[] = SHMDIR "/shmfd-XXXXXX";
>  #ifdef O_TMPFILE
>       fd = open(SHMDIR, O_TMPFILE|O_RDWR|O_CLOEXEC|O_EXCL, 0666);
> @@ -1209,15 +1208,21 @@ shm_tmpfile(void)
>       }
>       ErrorF ("Not using O_TMPFILE\n");
>  #endif
> +#ifdef HAVE_MKOSTEMP
> +     fd = mkostemp(template, O_CLOEXEC);
> +#else
>       fd = mkstemp(template);
> +#endif
>       if (fd < 0)
>               return -1;
>       unlink(template);
> -     flags = fcntl(fd, F_GETFD);
> +#ifndef HAVE_MKOSTEMP
> +     int flags = fcntl(fd, F_GETFD);

Do we allow mixed declarations and code nowadays?

Cheers,
Julien
_______________________________________________
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to