mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2026-02-03 13:40:34 +01:00
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>
(cherry picked from commit a5769de0f5)
This commit is contained in:
parent
07a9841c03
commit
0d573b03e0
1 changed files with 2 additions and 1 deletions
|
|
@ -1214,7 +1214,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…
Add table
Reference in a new issue