summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/cygheap.cc
diff options
context:
space:
mode:
Diffstat (limited to 'winsup/cygwin/cygheap.cc')
-rw-r--r--winsup/cygwin/cygheap.cc14
1 files changed, 14 insertions, 0 deletions
diff --git a/winsup/cygwin/cygheap.cc b/winsup/cygwin/cygheap.cc
index d7d15667c..279b7389e 100644
--- a/winsup/cygwin/cygheap.cc
+++ b/winsup/cygwin/cygheap.cc
@@ -90,6 +90,20 @@ cygheap_fixup_in_child (bool execed)
}
}
+int
+init_cygheap::manage_console_count (const char *something, int amount, bool avoid_freeing_console)
+{
+ console_count += amount;
+ debug_printf ("%s: console_count %d, amount %d, %s, avoid_freeing_console %d",
+ something, console_count, amount, myctty (), avoid_freeing_console);
+ if (!avoid_freeing_console && amount <= 0 && !console_count && myself->ctty == -1)
+ {
+ FreeConsole ();
+ debug_printf ("freed console");
+ }
+ return console_count;
+}
+
void
init_cygheap::close_ctty ()
{