From e80cbe3e52decfeb93fb121d624c2bf5cd42abf3 Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Sat, 3 Jan 2004 18:15:03 +0000 Subject: * cygheap.h (init_cygheap): Play more vfork shell games and move ctty_on_hold and open_fhs_on_hold (back) here. * dcrt0.cc (_dll_crt0): Just set impure_ptr_ptr here and let later initialization deal with tls. * dtable.cc (dtable::vfork_child_fixup): Move ctty considerations here. (dtable:vfork_parent_restore): And here. * fork.cc (vfork): Reflect change to ctty handling. * perthread.h (vfork_save::fhctty): Eliminate. * cygwin.din: Make more exports NOSIGFE that will never be interrupted by a signal. * init.cc (dll_entry): Set stackptr to NULL to catch problems earlier. --- winsup/cygwin/fork.cc | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) (limited to 'winsup/cygwin/fork.cc') diff --git a/winsup/cygwin/fork.cc b/winsup/cygwin/fork.cc index 477d85c0f..5671d1c33 100644 --- a/winsup/cygwin/fork.cc +++ b/winsup/cygwin/fork.cc @@ -719,7 +719,7 @@ vfork () vf->ctty = myself->ctty; vf->sid = myself->sid; vf->pgid = myself->pgid; - vf->fhctty = cygheap->ctty; + cygheap->ctty_on_hold = cygheap->ctty; vf->open_fhs = cygheap->open_fhs; int res = cygheap->fdtab.vfork_child_dup () ? 0 : -1; debug_printf ("%d = vfork()", res); @@ -739,20 +739,8 @@ vfork () myself->ctty = vf->ctty; myself->sid = vf->sid; myself->pgid = vf->pgid; - termios_printf ("cygheap->ctty %p, vf->fhctty %p", cygheap->ctty, vf->fhctty); - if (cygheap->ctty != vf->fhctty) - { - vf->fhctty->close (); - if (vf->pid <= 0) - { - if (vf->ctty) - vf->fhctty->close (); - cygheap->ctty = vf->fhctty; - } - } - - if (vf->pid <= 0) - cygheap->open_fhs = vf->open_fhs; + termios_printf ("cygheap->ctty %p, cygheap->ctty_on_hold %p", cygheap->ctty, cygheap->ctty_on_hold); + cygheap->open_fhs = vf->open_fhs; if (vf->pid < 0) { -- cgit v1.2.3