summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2010-10-23 18:55:01 +0000
committerChristopher Faylor <me@cgf.cx>2010-10-23 18:55:01 +0000
commit74882a259a97e56d906ad34b29604c4e25aa9a2b (patch)
tree79a49eb168b2b3d545c6c22a958a0d1a3c42d02b
parent50ed699a2a62146372d8544f603b4b30b8b6e421 (diff)
downloadcygnal-74882a259a97e56d906ad34b29604c4e25aa9a2b.tar.gz
cygnal-74882a259a97e56d906ad34b29604c4e25aa9a2b.tar.bz2
cygnal-74882a259a97e56d906ad34b29604c4e25aa9a2b.zip
* pinfo.cc (pinfo::exit): Reset tty pgrp to zero if no more handles open.
(_pinfo::set_ctty): Remove debugging stuff.
-rw-r--r--winsup/cygwin/ChangeLog5
-rw-r--r--winsup/cygwin/pinfo.cc8
2 files changed, 11 insertions, 2 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 599d26fc3..56e3b67c4 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,5 +1,10 @@
2010-10-23 Christopher Faylor <me+cygwin@cgf.cx>
+ * pinfo.cc (pinfo::exit): Reset tty pgrp to zero if no more handles open.
+ (_pinfo::set_ctty): Remove debugging stuff.
+
+2010-10-23 Christopher Faylor <me+cygwin@cgf.cx>
+
* fhandler_tty.cc (fhandler_pty_master::open): Remove debugging printf.
2010-10-23 Christopher Faylor <me+cygwin@cgf.cx>
diff --git a/winsup/cygwin/pinfo.cc b/winsup/cygwin/pinfo.cc
index c2709ead1..d45e0a3cf 100644
--- a/winsup/cygwin/pinfo.cc
+++ b/winsup/cygwin/pinfo.cc
@@ -186,6 +186,12 @@ pinfo::exit (DWORD n)
}
sigproc_terminate (ES_FINAL);
+ if (myself->ctty >= 0 && myself->ctty != TTY_CONSOLE)
+ {
+ tty *t = cygwin_shared->tty[myself->ctty];
+ if (!t->slave_alive ())
+ t->setpgid (0);
+ }
/* FIXME: There is a potential race between an execed process and its
parent here. I hated to add a mutex just for that, though. */
@@ -390,9 +396,7 @@ _pinfo::set_ctty (tty_min *tc, int flags, fhandler_tty_slave *arch)
else
sid = tc->getsid ();
if (tc->getpgid () == 0)
-{debug_printf ("setting pgid to %d", pgid);
tc->setpgid (pgid);
-}
if (cygheap->ctty != arch)
{
debug_printf ("cygheap->ctty %p, arch %p", cygheap->ctty, arch);