Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/winsup
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2011-06-01 05:47:51 +0400
committerChristopher Faylor <me@cgf.cx>2011-06-01 05:47:51 +0400
commit83e4d35a89d8d1c0e55e980263fffe6c65d2a2eb (patch)
tree1a285a0f18653b2cfbc305b42eaf332e6ec33757 /winsup
parentbe9b5aba2693adef4a1018d695baa6cb32afd441 (diff)
* 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')
-rw-r--r--winsup/cygwin/ChangeLog6
-rw-r--r--winsup/cygwin/exceptions.cc2
-rw-r--r--winsup/cygwin/fhandler_console.cc8
3 files changed, 10 insertions, 6 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 329047f0c..ae356b082 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,5 +1,11 @@
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>
+
* external.cc (fillout_pinfo): Don't truncate ctty if it's < 0.
* select.cc (pipe_data_available): Avoid printing debug info by default
diff --git a/winsup/cygwin/exceptions.cc b/winsup/cygwin/exceptions.cc
index 1c96b61a7..756a5f037 100644
--- a/winsup/cygwin/exceptions.cc
+++ b/winsup/cygwin/exceptions.cc
@@ -999,7 +999,7 @@ ctrl_c_handler (DWORD type)
tty_min *t = cygwin_shared->tty.get_cttyp ();
/* Ignore this if we're not the process group leader since it should be handled
*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)
/* 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
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