1 --- xc/programs/Xserver/hw/kdrive/linux/keyboard.c.orig 2001-11-08 10:26:24.000000000 +0000
2 +++ xc/programs/Xserver/hw/kdrive/linux/keyboard.c 2003-03-11 21:13:09.000000000 +0000
4 static struct termios LinuxTermios;
5 static int LinuxKbdType;
9 LinuxKeyboardEnable (int fd, void *closure)
12 unsigned char buf[256];
16 ioctl (fd, KDGKBMODE, &LinuxKbdTrans);
17 tcgetattr (fd, &LinuxTermios);
19 tcsetattr(fd, TCSANOW, &nTty);
21 * Flush any pending keystrokes
23 + * Also set to nonblock, just to be safe
25 + fd_orig_flags = fcntl( fd , F_GETFL, 0 );
26 + fcntl ( fd, F_SETFL, fd_orig_flags | O_NONBLOCK );
28 while ((n = read (fd, buf, sizeof (buf))) > 0)
32 + fcntl ( fd , F_SETFL, fd_orig_flags );