From 7176387b4fadccb76d53f2298cddcca1cad331b5 Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Tue, 9 Dec 2003 03:27:05 +0000 Subject: [PATCH] * pinfo.cc (_pinfo::set_ctty): Don't copy over existing ctty if it is active. --- winsup/cygwin/ChangeLog | 5 +++++ winsup/cygwin/pinfo.cc | 5 +---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 84def7ec0..78e66fbb5 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,8 @@ +2003-12-08 Christopher Faylor + + * pinfo.cc (_pinfo::set_ctty): Don't copy over existing ctty if it is + active. + 2003-12-08 Christopher Faylor * thread.cc (pthread::precreate): Delete duplicate setting of diff --git a/winsup/cygwin/pinfo.cc b/winsup/cygwin/pinfo.cc index b0f58b484..dfd140f0f 100644 --- a/winsup/cygwin/pinfo.cc +++ b/winsup/cygwin/pinfo.cc @@ -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); } }