* 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.
This commit is contained in:
Christopher Faylor 2009-05-06 17:16:33 +00:00
parent 967c052689
commit 6f5b891b7b
3 changed files with 10 additions and 3 deletions

View 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> 2009-05-06 Corinna Vinschen <corinna@vinschen.de>
* libc/minires.c (scanline): Fix type in calls to ctype functions * libc/minires.c (scanline): Fix type in calls to ctype functions

View File

@ -723,9 +723,9 @@ fhandler_console::ioctl (unsigned int cmd, void *buf)
} }
return 0; return 0;
case TIOCLINUX: 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; return 0;
} }
else else

View File

@ -1048,7 +1048,7 @@ fhandler_tty_slave::ioctl (unsigned int cmd, void *arg)
get_ttyp ()->arg.value = val; get_ttyp ()->arg.value = val;
SetEvent (ioctl_request_event); SetEvent (ioctl_request_event);
WaitForSingleObject (ioctl_done_event, INFINITE); WaitForSingleObject (ioctl_done_event, INFINITE);
*(unsigned char *) arg = get_ttyp ()->arg.value & 0xFF; *(unsigned char *) arg = (unsigned char) (get_ttyp ()->arg.value);
} }
break; break;
case KDGKBMETA: case KDGKBMETA: