diff options
author | Christopher Faylor <me@cgf.cx> | 2012-02-07 20:54:14 +0400 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2012-02-07 20:54:14 +0400 |
commit | 3e9c8f2e813c2a97362f91935871f5830efe1c21 (patch) | |
tree | f391db55b19ff6476a0d767214e1e6ec0e09697d /winsup/cygwin/fhandler_console.cc | |
parent | a72ada654ec07b43a57c2551ca9bc5bd5e9f9082 (diff) |
* 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/fhandler_console.cc')
-rw-r--r-- | winsup/cygwin/fhandler_console.cc | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/winsup/cygwin/fhandler_console.cc b/winsup/cygwin/fhandler_console.cc index 477265fe5..134b26141 100644 --- a/winsup/cygwin/fhandler_console.cc +++ b/winsup/cygwin/fhandler_console.cc @@ -1,7 +1,7 @@ /* fhandler_console.cc Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, - 2006, 2008, 2009, 2010, 2011 Red Hat, Inc. + 2006, 2008, 2009, 2010, 2011, 2012 Red Hat, Inc. This file is part of Cygwin. @@ -827,7 +827,6 @@ fhandler_console::open (int flags, mode_t) void fhandler_console::open_setup (int flags) { - cygheap->manage_console_count ("fhandler_console::open", 1); set_flags ((flags & ~O_TEXT) | O_BINARY); myself->set_ctty (this, flags); } @@ -838,7 +837,7 @@ fhandler_console::close () CloseHandle (get_io_handle ()); CloseHandle (get_output_handle ()); if (!have_execed) - cygheap->manage_console_count ("fhandler_console::close", -1); + free_console (); return 0; } @@ -2348,6 +2347,14 @@ fhandler_console::create_invisible_console_workaround () return invisible_console = true; } +void +fhandler_console::free_console () +{ + BOOL res = FreeConsole (); + debug_printf ("freed console, res %d", res); + init_console_handler (false); +} + bool fhandler_console::need_invisible () { |