]> pilppa.org Git - familiar-h63xx-build.git/blob - org.handhelds.familiar/packages/nonworking/xfree86/xfree86-4.3.0/tinyx-kbd-enable-fix.patch
OE tree imported from monotone branch org.openembedded.oz354fam083 at revision 8b12e3...
[familiar-h63xx-build.git] / org.handhelds.familiar / packages / nonworking / xfree86 / xfree86-4.3.0 / tinyx-kbd-enable-fix.patch
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
3 @@ -397,12 +397,13 @@
4  static struct termios  LinuxTermios;
5  static int             LinuxKbdType;
6  
7 -void
8 +int
9  LinuxKeyboardEnable (int fd, void *closure)
10  {
11      struct termios nTty;
12      unsigned char   buf[256];
13      int                    n;
14 +    int             fd_orig_flags;
15  
16      ioctl (fd, KDGKBMODE, &LinuxKbdTrans);
17      tcgetattr (fd, &LinuxTermios);
18 @@ -420,9 +421,18 @@
19      tcsetattr(fd, TCSANOW, &nTty);
20      /*
21       * Flush any pending keystrokes
22 +     *
23 +     * Also set to nonblock, just to be safe
24       */
25 +    fd_orig_flags  =  fcntl( fd , F_GETFL, 0 );
26 +    fcntl ( fd, F_SETFL, fd_orig_flags | O_NONBLOCK );
27 +
28      while ((n = read (fd, buf, sizeof (buf))) > 0)
29 -       ;
30 +       ;
31 +
32 +    fcntl ( fd ,  F_SETFL, fd_orig_flags );
33 +
34 +    return fd;
35  }
36  
37  void