summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/pinfo.cc
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2012-02-07 16:54:14 +0000
committerChristopher Faylor <me@cgf.cx>2012-02-07 16:54:14 +0000
commit3e9c8f2e813c2a97362f91935871f5830efe1c21 (patch)
treef391db55b19ff6476a0d767214e1e6ec0e09697d /winsup/cygwin/pinfo.cc
parenta72ada654ec07b43a57c2551ca9bc5bd5e9f9082 (diff)
downloadcygnal-3e9c8f2e813c2a97362f91935871f5830efe1c21.tar.gz
cygnal-3e9c8f2e813c2a97362f91935871f5830efe1c21.tar.bz2
cygnal-3e9c8f2e813c2a97362f91935871f5830efe1c21.zip
* cygheap.cc (init_cygheap::manage_console_count): Delete.
* cygheap.h (init_cygheap::manage_console_count): Ditto. (init_cygheap::console_count): Ditto. * fhandler.h (fhandler_console::has_a): Ditto. (fhandler_console::free_console): Declare new function. * fhandler_console.cc (fhandler_console::free_console): Define new function. (fhandler_console::open_setup): Delete call to manage_console_count. (fhandler_console::close): Ditto. Replace with call to free_console(). * fhandler_tty.cc (fhandler_pty_slave::open): Delete call to manage_console_count. (fhandler_pty_slave::cleanup): Ditto. (fhandler_pty_slave::close): Call fhandler_console::free_console() if this is our controlling tty. * pinfo.cc (_pinfo::set_ctty): Skip function if tty in question == our ctty. Delete call to manage_console_count. * syscalls.cc (close_all_files): Avoid locking and avoid setting errno when iterating over fds.
Diffstat (limited to 'winsup/cygwin/pinfo.cc')
-rw-r--r--winsup/cygwin/pinfo.cc3
1 files changed, 1 insertions, 2 deletions
diff --git a/winsup/cygwin/pinfo.cc b/winsup/cygwin/pinfo.cc
index 1de363f7d..04c6b64c8 100644
--- a/winsup/cygwin/pinfo.cc
+++ b/winsup/cygwin/pinfo.cc
@@ -435,7 +435,7 @@ _pinfo::set_ctty (fhandler_termios *fh, int flags)
{
tty_min& tc = *fh->tc ();
debug_printf ("old %s, ctty device number %p, tc.ntty device number %p flags & O_NOCTTY %p", __ctty (), ctty, tc.ntty, flags & O_NOCTTY);
- if (fh && &tc && (ctty <= 0 || ctty == tc.ntty) && !(flags & O_NOCTTY))
+ if (fh && &tc && (ctty <= 0 || ctty != tc.ntty) && !(flags & O_NOCTTY))
{
ctty = tc.ntty;
if (cygheap->ctty != fh->archetype)
@@ -454,7 +454,6 @@ _pinfo::set_ctty (fhandler_termios *fh, int flags)
{
fh->archetype_usecount (1);
/* guard ctty fh */
- cygheap->manage_console_count ("_pinfo::set_ctty", 1);
report_tty_counts (cygheap->ctty, "ctty", "");
}
}