wayland: Prevent leaking --wayland-fd and --xwayland-fd to child processes
fcntl() expects FD_CLOEXEC instead of conventional O_CLOEXEC.
This commit is contained in:
parent
0e3bf29e3b
commit
1e0d5bba71
1 changed files with 2 additions and 2 deletions
|
@ -505,7 +505,7 @@ int main(int argc, char *argv[])
|
|||
int fd = parser.value(waylandSocketFdOption).toInt(&ok);
|
||||
if (ok) {
|
||||
// make sure we don't leak this FD to children
|
||||
fcntl(fd, F_SETFD, O_CLOEXEC);
|
||||
fcntl(fd, F_SETFD, FD_CLOEXEC);
|
||||
server->display()->addSocketFileDescriptor(fd, socketName);
|
||||
} else {
|
||||
std::cerr << "FATAL ERROR: could not parse socket FD" << std::endl;
|
||||
|
@ -589,7 +589,7 @@ int main(int argc, char *argv[])
|
|||
int fd = fdString.toInt(&ok);
|
||||
if (ok) {
|
||||
// make sure we don't leak this FD to children
|
||||
fcntl(fd, F_SETFD, O_CLOEXEC);
|
||||
fcntl(fd, F_SETFD, FD_CLOEXEC);
|
||||
a.addXwaylandSocketFileDescriptor(fd);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue