summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/cygheap.cc
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2004-01-16 22:54:14 +0000
committerChristopher Faylor <me@cgf.cx>2004-01-16 22:54:14 +0000
commit49d0c04260e7bca17cdaf48c5cc4dffea5e312ab (patch)
tree15eff813f97625c418630d7c47c599f3752c2294 /winsup/cygwin/cygheap.cc
parent001197aee3f04f077c77ec99fce715ff43fac800 (diff)
downloadcygnal-49d0c04260e7bca17cdaf48c5cc4dffea5e312ab.tar.gz
cygnal-49d0c04260e7bca17cdaf48c5cc4dffea5e312ab.tar.bz2
cygnal-49d0c04260e7bca17cdaf48c5cc4dffea5e312ab.zip
* cygheap.cc (init_cygheap::close_ctty): Don't NULL ctty if it is still active.
Diffstat (limited to 'winsup/cygwin/cygheap.cc')
-rw-r--r--winsup/cygwin/cygheap.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/winsup/cygwin/cygheap.cc b/winsup/cygwin/cygheap.cc
index 0171f99f6..0e46c7317 100644
--- a/winsup/cygwin/cygheap.cc
+++ b/winsup/cygwin/cygheap.cc
@@ -176,10 +176,15 @@ void
init_cygheap::close_ctty ()
{
debug_printf ("closing cygheap->ctty %p", cygheap->ctty);
+ int usecount = cygheap->ctty->usecount;
cygheap->ctty->close ();
if (cygheap->ctty_on_hold == cygheap->ctty)
cygheap->ctty_on_hold = NULL;
- cygheap->ctty = NULL;
+ if (usecount == 1)
+ {
+ cygheap->ctty = NULL;
+ debug_printf ("setting cygheap->ctty to NULL");
+ }
}
#define pagetrunc(x) ((void *) (((DWORD) (x)) & ~(4096 - 1)))