diff options
author | Christopher Faylor <me@cgf.cx> | 2009-05-06 17:16:33 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2009-05-06 17:16:33 +0000 |
commit | 6f5b891b7b815b192581c89116e60a8ed7eb5009 (patch) | |
tree | 2596a70a2aa4123495cbeb0a9dea62043dff7c4b /winsup/cygwin | |
parent | 967c052689c9f5856ed6033ca029242de1365ea7 (diff) | |
download | newlib-6f5b891b7b815b192581c89116e60a8ed7eb5009.zip newlib-6f5b891b7b815b192581c89116e60a8ed7eb5009.tar.gz newlib-6f5b891b7b815b192581c89116e60a8ed7eb5009.tar.bz2 |
* 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.
Diffstat (limited to 'winsup/cygwin')
-rw-r--r-- | winsup/cygwin/ChangeLog | 7 | ||||
-rw-r--r-- | winsup/cygwin/fhandler_console.cc | 4 | ||||
-rw-r--r-- | winsup/cygwin/fhandler_tty.cc | 2 |
3 files changed, 10 insertions, 3 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 8da30a4..cfed63e 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -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 diff --git a/winsup/cygwin/fhandler_console.cc b/winsup/cygwin/fhandler_console.cc index 965f8aa..a2b2cd3 100644 --- a/winsup/cygwin/fhandler_console.cc +++ b/winsup/cygwin/fhandler_console.cc @@ -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 diff --git a/winsup/cygwin/fhandler_tty.cc b/winsup/cygwin/fhandler_tty.cc index 3249309..994d356 100644 --- a/winsup/cygwin/fhandler_tty.cc +++ b/winsup/cygwin/fhandler_tty.cc @@ -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: |