summaryrefslogtreecommitdiff
path: root/Xext/shm.c
diff options
context:
space:
mode:
authorJeremy Huddleston Sequoia <jeremyhu@apple.com>2016-09-11 19:47:47 -0700
committerJeremy Huddleston Sequoia <jeremyhu@apple.com>2016-09-13 10:00:51 -0700
commita5769de0f5399053e9864b753fa9755220d65ae0 (patch)
tree0887eaf07a2813e44a4bf34efaa421c250be19cb /Xext/shm.c
parent7def2fea30060d47780dc1eedc91fada5ae1934f (diff)
Xext/shm: Fix usage of F_GETFD to match standard
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 <jeremyhu@apple.com> Reviewed-by: Julien Cristau <jcristau@debian.org>
Diffstat (limited to 'Xext/shm.c')
-rw-r--r--Xext/shm.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Xext/shm.c b/Xext/shm.c
index 05575385b..125000f5f 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);
}