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>
This commit is contained in:
parent
7def2fea30
commit
a5769de0f5
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user