OSDN Git Service

* pinfo.cc (_pinfo::set_ctty): Don't copy over existing ctty if it is active.
authorcgf <cgf>
Tue, 9 Dec 2003 03:27:05 +0000 (03:27 +0000)
committercgf <cgf>
Tue, 9 Dec 2003 03:27:05 +0000 (03:27 +0000)
winsup/cygwin/ChangeLog
winsup/cygwin/pinfo.cc

index 84def7e..78e66fb 100644 (file)
@@ -1,5 +1,10 @@
 2003-12-08  Christopher Faylor  <cgf@redhat.com>
 
+       * pinfo.cc (_pinfo::set_ctty): Don't copy over existing ctty if it is
+       active.
+
+2003-12-08  Christopher Faylor  <cgf@redhat.com>
+
        * thread.cc (pthread::precreate): Delete duplicate setting of
        cancel_event.
 
index b0f58b4..dfd140f 100644 (file)
@@ -257,7 +257,6 @@ pinfo::set_acl()
 void
 _pinfo::set_ctty (tty_min *tc, int flags, fhandler_tty_slave *fhctty)
 {
-  int initial_ctty = ctty;
   if ((ctty < 0 || ctty == tc->ntty) && !(flags & O_NOCTTY))
     {
       ctty = tc->ntty;
@@ -277,10 +276,8 @@ _pinfo::set_ctty (tty_min *tc, int flags, fhandler_tty_slave *fhctty)
        sid = tc->getsid ();
       if (tc->getpgid () == 0)
        tc->setpgid (pgid);
-      if (fhctty)
+      if (fhctty && !cygheap->ctty.get_io_handle ())
        cygheap->ctty  = *fhctty;
-      else if (initial_ctty < 0)
-       assert (cygheap->ctty.get_io_handle () == NULL);
     }
 }