Make sure SDL file descriptors don't leak into child processes

This commit is contained in:
Sam Lantinga 2021-09-08 14:47:40 -07:00
parent 3ed8ba7d33
commit bf97c5a22f
15 changed files with 24 additions and 24 deletions

View file

@ -354,7 +354,7 @@ SDL_EVDEV_kbd_init(void)
kbd->npadch = -1;
/* This might fail if we're not connected to a tty (e.g. on the Steam Link) */
kbd->console_fd = open("/dev/tty", O_RDONLY);
kbd->console_fd = open("/dev/tty", O_RDONLY | O_CLOEXEC);
if (ioctl(kbd->console_fd, TIOCLINUX, shift_state) == 0) {
kbd->shift_state = *shift_state;