mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2026-01-04 14:30:13 +01:00
os, shm: fcntl()'s third argument is integer, not pointer
All of these uses were attempting to set FD_CLOEXEC, which happens to be (1<<0). Since flags is going to be aligned in memory, its address is never going to have the low bit set, so we were never actually setting what we meant to. Fixes: xorg/xserver#1114
This commit is contained in:
parent
5e3900904d
commit
365cbbfc4b
2 changed files with 3 additions and 3 deletions
|
|
@ -1248,7 +1248,7 @@ shm_tmpfile(void)
|
|||
int flags = fcntl(fd, F_GETFD);
|
||||
if (flags != -1) {
|
||||
flags |= FD_CLOEXEC;
|
||||
(void) fcntl(fd, F_SETFD, &flags);
|
||||
(void) fcntl(fd, F_SETFD, flags);
|
||||
}
|
||||
#endif
|
||||
return fd;
|
||||
|
|
|
|||
|
|
@ -427,7 +427,7 @@ InputThreadPreInit(void)
|
|||
flags = fcntl(inputThreadInfo->readPipe, F_GETFD);
|
||||
if (flags != -1) {
|
||||
flags |= FD_CLOEXEC;
|
||||
(void)fcntl(inputThreadInfo->readPipe, F_SETFD, &flags);
|
||||
(void)fcntl(inputThreadInfo->readPipe, F_SETFD, flags);
|
||||
}
|
||||
SetNotifyFd(inputThreadInfo->readPipe, InputThreadNotifyPipe, X_NOTIFY_READ, NULL);
|
||||
|
||||
|
|
@ -438,7 +438,7 @@ InputThreadPreInit(void)
|
|||
flags = fcntl(hotplugPipeRead, F_GETFD);
|
||||
if (flags != -1) {
|
||||
flags |= FD_CLOEXEC;
|
||||
(void)fcntl(hotplugPipeRead, F_SETFD, &flags);
|
||||
(void)fcntl(hotplugPipeRead, F_SETFD, flags);
|
||||
}
|
||||
hotplugPipeWrite = hotplugPipe[1];
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue