fcntl(fd, F_SETFD, ...) requires an integer but Xorg passes a pointer sometimes
As reported in https://twitter.com/alexpignotti/status/1339699424591790082 Xorg is inconsistent about the argument type passed for the third parameter to fcntl(fd, F_SETFD, ...)
calls:
Xext/shm.c: (void) fcntl(fd, F_SETFD, &flags);
hw/xquartz/X11Controller.m: fcntl(stdout_pipe[0], F_SETFD, FD_CLOEXEC);
hw/xquartz/X11Controller.m: fcntl(stderr_pipe[0], F_SETFD, FD_CLOEXEC);
hw/xquartz/console_redirect.c: if (fcntl(pipepair[0], F_SETFD, FD_CLOEXEC) == -1)
hw/xwayland/xwayland-shm.c: if (fcntl(fd, F_SETFD, flags | FD_CLOEXEC) == -1)
os/inputthread.c: (void)fcntl(inputThreadInfo->readPipe, F_SETFD, &flags);
os/inputthread.c: (void)fcntl(hotplugPipeRead, F_SETFD, &flags);
os/utils.c: fcntl(newfd, F_SETFD, FD_CLOEXEC);
The ones passing &flags
should just be passing flags
instead.