* fhandler_tty.cc (fhandler_tty_slave::ioctl): Properly set ioctl_request event
when window size changes. Store failing errno in ioctl_retval (needed?).
This commit is contained in:
		| @@ -1,3 +1,9 @@ | ||||
| 2003-09-26  Christopher Faylor  <cgf@redhat.com> | ||||
|  | ||||
| 	* fhandler_tty.cc (fhandler_tty_slave::ioctl): Properly set | ||||
| 	ioctl_request event when window size changes.  Store failing errno in | ||||
| 	ioctl_retval (needed?). | ||||
|  | ||||
| 2003-09-26  Pavel Tsekov  <ptsekov@gmx.net> | ||||
|  | ||||
| 	* fhandler_console.c (fhandler_console::read): Record the state of the | ||||
|   | ||||
| @@ -1057,43 +1057,44 @@ fhandler_tty_slave::ioctl (unsigned int cmd, void *arg) | ||||
|       if (get_ttyp ()->winsize.ws_row != ((struct winsize *) arg)->ws_row | ||||
| 	  || get_ttyp ()->winsize.ws_col != ((struct winsize *) arg)->ws_col) | ||||
| 	{ | ||||
| 	  get_ttyp ()->arg.winsize = *(struct winsize *) arg; | ||||
| 	  if (ioctl_request_event) | ||||
| 	    { | ||||
| 	      get_ttyp ()->ioctl_retval = -1; | ||||
| 	      SetEvent (ioctl_request_event); | ||||
| 	    } | ||||
| 	  if (!ioctl_request_event) | ||||
| 	    get_ttyp ()->ioctl_retval = -EINVAL; | ||||
| 	  else | ||||
| 	    { | ||||
| 	      get_ttyp ()->arg.winsize = *(struct winsize *) arg; | ||||
| 	      SetEvent (ioctl_request_event); | ||||
| 	      get_ttyp ()->winsize = *(struct winsize *) arg; | ||||
| 	      kill (-get_ttyp ()->getpgid (), SIGWINCH); | ||||
| 	    } | ||||
| 	      if (ioctl_done_event) | ||||
| 		WaitForSingleObject (ioctl_done_event, INFINITE); | ||||
| 	    } | ||||
| 	} | ||||
|       break; | ||||
|     case TIOCLINUX: | ||||
|       int val = *(unsigned char *) arg; | ||||
|       if (val == 6 && ioctl_request_event && ioctl_done_event) | ||||
|       if (val != 6 || !ioctl_request_event || !ioctl_done_event) | ||||
| 	  get_ttyp ()->ioctl_retval = -EINVAL; | ||||
|       else | ||||
| 	{ | ||||
| 	  get_ttyp ()->arg.value = val; | ||||
| 	  SetEvent (ioctl_request_event); | ||||
| 	  WaitForSingleObject (ioctl_done_event, INFINITE); | ||||
| 	  *(unsigned char *) arg = get_ttyp ()->arg.value & 0xFF; | ||||
| 	} | ||||
|       else | ||||
| 	{ | ||||
| 	  get_ttyp ()->ioctl_retval = -1; | ||||
| 	  set_errno (EINVAL); | ||||
| 	} | ||||
|       break; | ||||
|     } | ||||
|  | ||||
|   release_output_mutex (); | ||||
|  | ||||
| out: | ||||
|   termios_printf ("%d = ioctl (%x)", get_ttyp ()->ioctl_retval, cmd); | ||||
|   return get_ttyp ()->ioctl_retval; | ||||
|   int retval = get_ttyp ()->ioctl_retval; | ||||
|   if (retval < 0) | ||||
|     { | ||||
|       set_errno (-retval); | ||||
|       retval = -1; | ||||
|     } | ||||
|   termios_printf ("%d = ioctl (%x)", retval, cmd); | ||||
|   return retval; | ||||
| } | ||||
|  | ||||
| /******************************************************* | ||||
|   | ||||
							
								
								
									
										20
									
								
								winsup/cygwin/include/cygwin/kd.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										20
									
								
								winsup/cygwin/include/cygwin/kd.h
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,20 @@ | ||||
| /* cygwin/kd.h | ||||
|  | ||||
|    Copyright 2003 Red Hat Inc. | ||||
|    Written by Kazuhiro Fujieda <fujieda@jaist.ac.jp> | ||||
|  | ||||
| This file is part of Cygwin. | ||||
|  | ||||
| This software is a copyrighted work licensed under the terms of the | ||||
| Cygwin license.  Please consult the file "CYGWIN_LICENSE" for | ||||
| details. */ | ||||
|  | ||||
| #ifndef _CYGWIN_KD_H_ | ||||
| #define _CYGWIN_KD_H_ | ||||
|  | ||||
| #define KDGKBMETA 0x4b62 | ||||
| #define KDSKBMETA 0x4b63 | ||||
| #define K_METABIT 0x03 | ||||
| #define K_ESCPREFIX 0x04 | ||||
|  | ||||
| #endif | ||||
		Reference in New Issue
	
	Block a user