From 9661a0c8b7f59960d6d180ffa2872710f5253913 Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Sat, 15 Sep 2001 00:47:44 +0000 Subject: * dcrt0.cc (dll_crt0_1): Create vfork main storage here so that it can be queried in waitsig later. * sigproc.cc (wait_sig): Don't deliver a signal if in a vfork. * fork.cc (vfork): Deliver all signals on parent return from vfork. --- winsup/cygwin/fork.cc | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'winsup/cygwin/fork.cc') diff --git a/winsup/cygwin/fork.cc b/winsup/cygwin/fork.cc index 30fca7b2d..c4d122f4d 100644 --- a/winsup/cygwin/fork.cc +++ b/winsup/cygwin/fork.cc @@ -700,6 +700,7 @@ vfork () #ifndef NEWVFORK return fork (); #else + sigframe thisframe; vfork_save *vf = get_vfork_val (); char **esp, **pp; @@ -714,22 +715,22 @@ vfork () __asm__ volatile ("movl %%esp,%0": "=r" (vf->vfork_esp):); __asm__ volatile ("movl %%ebp,%0": "=r" (vf->vfork_ebp):); for (pp = (char **)vf->frame, esp = vf->vfork_esp; - esp <= vf->vfork_ebp + 1; pp++, esp++) + esp <= vf->vfork_ebp + 2; pp++, esp++) *pp = *esp; int res = cygheap->fdtab.vfork_child_dup () ? 0 : -1; debug_printf ("%d = vfork()", res); return res; } - cygheap->fdtab.vfork_parent_restore (); - vf = get_vfork_val (); - __asm__ volatile ("movl %%esp,%0": "=r" (esp):); for (pp = (char **)vf->frame, esp = vf->vfork_esp; - esp <= vf->vfork_ebp + 1; pp++, esp++) + esp <= vf->vfork_ebp + 2; pp++, esp++) *esp = *pp; + thisframe.init (mainthread); + cygheap->fdtab.vfork_parent_restore (); + if (vf->pid < 0) { int exitval = -vf->pid; @@ -740,6 +741,7 @@ vfork () int pid = vf->pid; vf->pid = 0; + sig_dispatch_pending (); return pid; #endif } -- cgit v1.2.3