]> sourceware.org Git - newlib-cygwin.git/commitdiff
* fhandler_console.cc (fhandler_console::ioctl): Properly treat TIOCLINUX
authorChristopher Faylor <me@cgf.cx>
Wed, 6 May 2009 17:16:33 +0000 (17:16 +0000)
committerChristopher Faylor <me@cgf.cx>
Wed, 6 May 2009 17:16:33 +0000 (17:16 +0000)
argument as a char.
* fhandler_tty.cc (fhandler_tty_slave::ioctl): Use coercion to properly set
char value.

winsup/cygwin/ChangeLog
winsup/cygwin/fhandler_console.cc
winsup/cygwin/fhandler_tty.cc

index 8da30a4bcbedae1aeb457bb669f6e1a163b75f5f..cfed63eaff615d6d0a124efee7d89fb72351336b 100644 (file)
@@ -1,3 +1,10 @@
+2009-05-06  Christopher Faylor  <me+cygwin@cgf.cx>
+
+       * fhandler_console.cc (fhandler_console::ioctl): Properly treat
+       TIOCLINUX argument as a char.
+       * fhandler_tty.cc (fhandler_tty_slave::ioctl): Use coercion to properly
+       set char value.
+
 2009-05-06  Corinna Vinschen  <corinna@vinschen.de>
 
        * libc/minires.c (scanline): Fix type in calls to ctype functions
index 965f8aadf31039cf2f8f37317c53fb2df8882471..a2b2cd38c03da19cbddfa7fc38cb6f6f01e147e3 100644 (file)
@@ -723,9 +723,9 @@ fhandler_console::ioctl (unsigned int cmd, void *buf)
          }
        return 0;
       case TIOCLINUX:
-       if (* (int *) buf == 6)
+       if (*(unsigned char *) buf == 6)
          {
-           * (int *) buf = dev_state->nModifiers;
+           *(unsigned char *) buf = (unsigned char) dev_state->nModifiers;
            return 0;
          }
        else
index 32493090f4c8aa61093b0d075fc2306d55f102b9..994d356c0493670809f89a6c1357efb98ddf1542 100644 (file)
@@ -1048,7 +1048,7 @@ fhandler_tty_slave::ioctl (unsigned int cmd, void *arg)
          get_ttyp ()->arg.value = val;
          SetEvent (ioctl_request_event);
          WaitForSingleObject (ioctl_done_event, INFINITE);
-         *(unsigned char *) arg = get_ttyp ()->arg.value & 0xFF;
+         *(unsigned char *) arg = (unsigned char) (get_ttyp ()->arg.value);
        }
       break;
     case KDGKBMETA:
This page took 0.041842 seconds and 5 git commands to generate.