From 6daf4afb11869add20516ef4ae451898840f1ffa Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Wed, 21 Mar 2012 05:23:13 +0000 Subject: * child_info.h: Reset magic number. (child_info_spawn::wait_for_myself): Move function to sigproc.cc. * pinfo.cc (is_toplevel_proc): Delete unneeded variable. * sigproc.cc (child_info_spawn::wait_for_myself): Move function from header to here. Do all setup required to properly wait for top-level execed process to exit. * spawn.cc (child_info_spawn::worker): Attempt to properly handle _P_DETACH. Set wr_proc_pipe if top-level process even when execing. Just call wait_for_myself() to... wait for myself. Don't call cleanup twice. --- winsup/cygwin/sigproc.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'winsup/cygwin/sigproc.cc') diff --git a/winsup/cygwin/sigproc.cc b/winsup/cygwin/sigproc.cc index 78281792f..967a97e3a 100644 --- a/winsup/cygwin/sigproc.cc +++ b/winsup/cygwin/sigproc.cc @@ -911,6 +911,16 @@ cygheap_exec_info::alloc () + (nprocs * sizeof (children[0]))); } +void +child_info_spawn::wait_for_myself () +{ + myself.set_rd_proc_pipe (rd_proc_pipe); + ForceCloseHandle (wr_proc_pipe); + wr_proc_pipe = NULL; + myself.remember (false); + WaitForSingleObject (ev, INFINITE); +} + void child_info::cleanup () { -- cgit v1.2.3