diff options
author | Christopher Faylor <me@cgf.cx> | 2011-06-01 01:47:51 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2011-06-01 01:47:51 +0000 |
commit | 83e4d35a89d8d1c0e55e980263fffe6c65d2a2eb (patch) | |
tree | 1a285a0f18653b2cfbc305b42eaf332e6ec33757 /winsup/cygwin/fhandler_console.cc | |
parent | be9b5aba2693adef4a1018d695baa6cb32afd441 (diff) | |
download | cygnal-83e4d35a89d8d1c0e55e980263fffe6c65d2a2eb.tar.gz cygnal-83e4d35a89d8d1c0e55e980263fffe6c65d2a2eb.tar.bz2 cygnal-83e4d35a89d8d1c0e55e980263fffe6c65d2a2eb.zip |
* 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.
Diffstat (limited to 'winsup/cygwin/fhandler_console.cc')
-rw-r--r-- | winsup/cygwin/fhandler_console.cc | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/winsup/cygwin/fhandler_console.cc b/winsup/cygwin/fhandler_console.cc index f8a4140d6..4faa605d7 100644 --- a/winsup/cygwin/fhandler_console.cc +++ b/winsup/cygwin/fhandler_console.cc @@ -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"); } - bool fhandler_console::set_unit () { @@ -193,14 +192,13 @@ fhandler_console::get_tty_stuff () tty_min * tty_list::get_cttyp () { - static tty_min nada; _dev_t n = myself->ctty; if (iscons_dev (n)) - return &shared_console_info->tty_min_state; - else if (n > 0) + return shared_console_info ? &shared_console_info->tty_min_state : NULL; + else if (istty_slave_dev (n)) return &ttys[device::minor (n)]; else - return &nada; + return NULL; } inline DWORD |