Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Xvnc: do not use dup2() to create a file descriptor for -inetd option #1714

Merged
merged 1 commit into from
Jan 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions unix/xserver/hw/vnc/xvnc.c
Original file line number Diff line number Diff line change
Expand Up @@ -366,8 +366,10 @@ ddxProcessArgument(int argc, char *argv[], int i)
if (strcmp(argv[i], "-inetd") == 0) {
int nullfd;

dup2(0, 3);
vncInetdSock = 3;
if ((vncInetdSock = dup(0)) == -1)
FatalError
("Xvnc error: failed to allocate a new file descriptor for -inetd: %s\n", strerror(errno));


/* Avoid xserver >= 1.19's epoll-fd becoming fd 2 / stderr only to be
replaced by /dev/null by OsInit() because the pollfd is not
Expand Down