diff options
Diffstat (limited to 'src/test-tty-idle-monitor.c')
-rw-r--r-- | src/test-tty-idle-monitor.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/src/test-tty-idle-monitor.c b/src/test-tty-idle-monitor.c index 8517f75..725505d 100644 --- a/src/test-tty-idle-monitor.c +++ b/src/test-tty-idle-monitor.c @@ -41,6 +41,7 @@ #include <glib.h> #include "ck-tty-idle-monitor.h" +#include "ck-sysdeps.h" static void idle_changed_cb (CkTtyIdleMonitor *monitor, @@ -55,8 +56,6 @@ is_console (const char *device) { int fd; gboolean ret; - int kb_ok; - char arg; ret = FALSE; fd = open (device, O_RDONLY | O_NOCTTY); @@ -64,14 +63,7 @@ is_console (const char *device) goto out; } -#ifdef __linux__ - kb_ok = (ioctl (fd, KDGKBTYPE, &arg) == 0 - && ((arg == KB_101) || (arg == KB_84))); -#else - kb_ok = 1; -#endif - - ret = (isatty (fd) && kb_ok); + ret = ck_fd_is_a_console (fd); close (fd); |