* exceptions.cc (ctrl_c_handler): Simplify test for no parent tty.
* fhandler_console.cc (fhandler_console::get_tty_stuff): Return NULL if ctty is not tty/console. Improve test for slave tty/pty device.
This commit is contained in:
		| @@ -1,3 +1,9 @@ | |||||||
|  | 2011-05-31  Christopher Faylor  <me.cygwin2011@cgf.cx> | ||||||
|  |  | ||||||
|  | 	* exceptions.cc (ctrl_c_handler): Simplify test for no parent tty. | ||||||
|  | 	* fhandler_console.cc (fhandler_console::get_tty_stuff): Return NULL if | ||||||
|  | 	ctty is not tty/console.  Improve test for slave tty/pty device. | ||||||
|  |  | ||||||
| 2011-05-31  Christopher Faylor  <me.cygwin2011@cgf.cx> | 2011-05-31  Christopher Faylor  <me.cygwin2011@cgf.cx> | ||||||
|  |  | ||||||
| 	* external.cc (fillout_pinfo): Don't truncate ctty if it's < 0. | 	* external.cc (fillout_pinfo): Don't truncate ctty if it's < 0. | ||||||
|   | |||||||
| @@ -999,7 +999,7 @@ ctrl_c_handler (DWORD type) | |||||||
|   tty_min *t = cygwin_shared->tty.get_cttyp (); |   tty_min *t = cygwin_shared->tty.get_cttyp (); | ||||||
|   /* Ignore this if we're not the process group leader since it should be handled |   /* Ignore this if we're not the process group leader since it should be handled | ||||||
|      *by* the process group leader. */ |      *by* the process group leader. */ | ||||||
|   if (myself->ctty != -1 && t->getpgid () == myself->pid && |   if (t && t->getpgid () == myself->pid && | ||||||
|        (GetTickCount () - t->last_ctrl_c) >= MIN_CTRL_C_SLOP) |        (GetTickCount () - t->last_ctrl_c) >= MIN_CTRL_C_SLOP) | ||||||
|     /* Otherwise we just send a SIGINT to the process group and return TRUE (to indicate |     /* Otherwise we just send a SIGINT to the process group and return TRUE (to indicate | ||||||
|        that we have handled the signal).  At this point, type should be |        that we have handled the signal).  At this point, type should be | ||||||
|   | |||||||
| @@ -127,7 +127,6 @@ console_unit::console_unit (HWND me0): | |||||||
|     api_fatal ("console device allocation failure - too many consoles in use, max consoles is 32"); |     api_fatal ("console device allocation failure - too many consoles in use, max consoles is 32"); | ||||||
| } | } | ||||||
|  |  | ||||||
|  |  | ||||||
| bool | bool | ||||||
| fhandler_console::set_unit () | fhandler_console::set_unit () | ||||||
| { | { | ||||||
| @@ -193,14 +192,13 @@ fhandler_console::get_tty_stuff () | |||||||
| tty_min * | tty_min * | ||||||
| tty_list::get_cttyp () | tty_list::get_cttyp () | ||||||
| { | { | ||||||
|   static tty_min nada; |  | ||||||
|   _dev_t n = myself->ctty; |   _dev_t n = myself->ctty; | ||||||
|   if (iscons_dev (n)) |   if (iscons_dev (n)) | ||||||
|     return &shared_console_info->tty_min_state; |     return shared_console_info ? &shared_console_info->tty_min_state : NULL; | ||||||
|   else if (n > 0) |   else if (istty_slave_dev (n)) | ||||||
|     return &ttys[device::minor (n)]; |     return &ttys[device::minor (n)]; | ||||||
|   else |   else | ||||||
|     return &nada; |     return NULL; | ||||||
| } | } | ||||||
|  |  | ||||||
| inline DWORD | inline DWORD | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user