From 7b66295e05f8cbfaab59ca92714e134b817b6811 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sun, 8 Jan 2017 19:04:38 -0800 Subject: [PATCH] Removed console check, let the kernel decide whether muting is appropriate on this terminal. We don't fail the init if we can't mute the terminal (we might be running from ssh, or on a system without virtual terminals, etc.) --- src/core/linux/SDL_evdev.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/src/core/linux/SDL_evdev.c b/src/core/linux/SDL_evdev.c index 36166e369..3d1596165 100644 --- a/src/core/linux/SDL_evdev.c +++ b/src/core/linux/SDL_evdev.c @@ -135,20 +135,9 @@ static Uint8 EVDEV_MouseButtons[] = { SDL_BUTTON_X2 + 3 /* BTN_TASK 0x117 */ }; -static int SDL_EVDEV_is_console(int fd) { - char type; - - return isatty(fd) && ioctl(fd, KDGKBTYPE, &type) == 0 && - (type == KB_101 || type == KB_84); -} - /* Prevent keystrokes from reaching the tty */ static int SDL_EVDEV_mute_keyboard(int tty_fd, int* old_kb_mode) { - if (!SDL_EVDEV_is_console(tty_fd)) { - return SDL_SetError("Tried to mute an invalid tty"); - } - if (ioctl(tty_fd, KDGKBMODE, old_kb_mode) < 0) { return SDL_SetError("Failed to get keyboard mode during muting"); } @@ -164,7 +153,7 @@ static int SDL_EVDEV_mute_keyboard(int tty_fd, int* old_kb_mode) static void SDL_EVDEV_unmute_keyboard(int tty_fd, int old_kb_mode) { if (ioctl(tty_fd, KDSKBMODE, old_kb_mode) < 0) { - SDL_Log("Failed to set keyboard mode"); + SDL_SetError("Failed to set keyboard mode during unmuting"); } }