* pinfo.cc (_pinfo::set_ctty): Revert 2012-02-07 change to skip function if tty

in question == our ctty.
* syscalls.cc (setsid): Avoid two function calls.
* dtable.cc (dtable::dup_worker): Remove debugging.
* init.cc (search_for): Calculate for every new process rather than using
shared value.
(threadfunc_ix): Fill in for ever new process rather than sing shared value.
This commit is contained in:
Christopher Faylor
2012-02-14 19:08:20 +00:00
parent 5401796acf
commit 4eb5175d90
5 changed files with 22 additions and 18 deletions

View File

@@ -435,7 +435,7 @@ _pinfo::set_ctty (fhandler_termios *fh, int flags)
{
tty_min& tc = *fh->tc ();
debug_printf ("old %s, ctty device number %p, tc.ntty device number %p flags & O_NOCTTY %p", __ctty (), ctty, tc.ntty, flags & O_NOCTTY);
if (fh && &tc && (ctty <= 0 || ctty != tc.ntty) && !(flags & O_NOCTTY))
if (fh && &tc && (ctty <= 0 || ctty == tc.ntty) && !(flags & O_NOCTTY))
{
ctty = tc.ntty;
if (cygheap->ctty != fh->archetype)
@@ -463,9 +463,7 @@ _pinfo::set_ctty (fhandler_termios *fh, int flags)
__ctty (), sid, pid, pgid, tc.getpgid (), tc.getsid ());
if (!cygwin_finished_initializing && !myself->cygstarted
&& pgid == pid && tc.getpgid () && tc.getsid ())
{
pgid = tc.getpgid ();
}
pgid = tc.getpgid ();
/* May actually need to do this: