On Sun, Sep 11, 2016 at 20:01:49 -0700, Jeremy Huddleston Sequoia wrote:

> flags = fcntl(fd, F_GETFD) is compliant.
> 
> fcntl(fd, F_GETFD, &flags) is non-compliant (Linux extension?)
> 
> cf: http://pubs.opengroup.org/onlinepubs/9699919799/functions/fcntl.html
> Signed-off-by: Jeremy Huddleston Sequoia <jerem...@apple.com>
> ---
>  Xext/shm.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
Reviewed-by: Julien Cristau <jcris...@debian.org>

Cheers,
Julien

> diff --git a/Xext/shm.c b/Xext/shm.c
> index 0557538..125000f 100644
> --- a/Xext/shm.c
> +++ b/Xext/shm.c
> @@ -1213,7 +1213,8 @@ shm_tmpfile(void)
>       if (fd < 0)
>               return -1;
>       unlink(template);
> -     if (fcntl(fd, F_GETFD, &flags) >= 0) {
> +     flags = fcntl(fd, F_GETFD);
> +     if (flags != -1) {
>               flags |= FD_CLOEXEC;
>               (void) fcntl(fd, F_SETFD, &flags);
>       }
> -- 
> 2.10.0 (Apple Git-99)
> 
> _______________________________________________
> 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
_______________________________________________
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