]> sourceware.org Git - newlib-cygwin.git/commitdiff
* syscalls.cc (close_all_files): Simplify logic around closing ctty.
authorChristopher Faylor <me@cgf.cx>
Sat, 27 Dec 2003 02:41:07 +0000 (02:41 +0000)
committerChristopher Faylor <me@cgf.cx>
Sat, 27 Dec 2003 02:41:07 +0000 (02:41 +0000)
winsup/cygwin/ChangeLog
winsup/cygwin/syscalls.cc

index 6067f5e1b815bbba5e887aec9d6ca1b032feab28..34522488979b89b6def6a9714202ba98b04de2c8 100644 (file)
@@ -1,3 +1,7 @@
+2003-12-26  Christopher Faylor  <cgf@redhat.com>
+
+       * syscalls.cc (close_all_files): Simplify logic around closing ctty.
+
 2003-12-26  Christopher Faylor  <cgf@redhat.com>
 
        * pinfo.cc (_pinfo::set_ctty): *Always* call close on opened ctty since
index 4a8cadefa7117161698f9c1671d52e4453676eb8..8bf74d5ae9beede5383d4b5545bf9b3f2b500caa 100644 (file)
@@ -89,15 +89,6 @@ close_all_files (void)
 {
   SetResourceLock (LOCK_FD_LIST, WRITE_LOCK | READ_LOCK, "close_all_files");
 
-  if (cygheap->ctty)
-    {
-      if (cygheap->ctty->usecount == 1)
-       cygheap->ctty->close ();
-      else
-       cygheap->ctty->usecount--;
-      debug_printf ("ctty usecount %d", cygheap->ctty->archetype->usecount);
-    }
-
   fhandler_base *fh;
   for (int i = 0; i < (int) cygheap->fdtab.size; i++)
     if ((fh = cygheap->fdtab[i]) != NULL)
@@ -109,6 +100,12 @@ close_all_files (void)
        cygheap->fdtab.release (i);
       }
 
+  if (cygheap->ctty)
+    {
+      debug_printf ("closing ctty");
+      cygheap->ctty->close ();
+    }
+
   ReleaseResourceLock (LOCK_FD_LIST, WRITE_LOCK | READ_LOCK, "close_all_files");
   user_shared->delqueue.process_queue ();
 }
This page took 0.03501 seconds and 5 git commands to generate.