]> sourceware.org Git - newlib-cygwin.git/commitdiff
* cygheap.cc (init_cygheap::close_ctty): Don't NULL ctty if it is still active.
authorChristopher Faylor <me@cgf.cx>
Fri, 16 Jan 2004 22:54:14 +0000 (22:54 +0000)
committerChristopher Faylor <me@cgf.cx>
Fri, 16 Jan 2004 22:54:14 +0000 (22:54 +0000)
winsup/cygwin/ChangeLog
winsup/cygwin/cygheap.cc

index b8fad26768c2967335887555f7d1249f9191f65b..a92ce1b22c77476004457400667f68efa2aa0c8e 100644 (file)
@@ -1,3 +1,8 @@
+2004-01-16  Christopher Faylor  <cgf@redhat.com>
+
+       * cygheap.cc (init_cygheap::close_ctty): Don't NULL ctty if it is still
+       active.
+
 2004-01-16  Christopher Faylor  <cgf@redhat.com>
 
        * dtable.cc (dtable::vfork_parent_restore): Store ctty_on_hold prior to
index 0171f99f68746d0f63ba9156820d0df37089fb53..0e46c731706f83e6752f6d9ec20f374d636e48da 100644 (file)
@@ -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)))
This page took 0.031322 seconds and 5 git commands to generate.