summaryrefslogtreecommitdiff
path: root/winsup/cygwin/sigproc.cc
diff options
context:
space:
mode:
authorChristopher Faylor <cgf@redhat.com>2004-11-24 05:48:28 +0000
committerChristopher Faylor <cgf@redhat.com>2004-11-24 05:48:28 +0000
commit721f24da41302a9a98c81476cf4247c386f480ad (patch)
tree466e80315f518eb5f5dab2a34dd55d50ade6e582 /winsup/cygwin/sigproc.cc
parentb672e14da40309c3dc402cb605ca5150d812f6ad (diff)
downloadgdb-noreparent.tar.gz
* child_info.h (child_info_spawn::hexec_proc): Eliminate.noreparentcvs/noreparent
* dcrt0.cc (dll_crt0_0): Remove hexec_proc stuff. * fork.cc (fork_child): Remove call to pinfo_fixup_after_fork. * pinfo.cc (set_myself): Close and zero pid_handle if set. (pinfo_fixup_after_fork): Delete. (proc_waiter): Don't close vchild.hProcess here. Do that when we are remove the vchild from procs. Save hProcess as pid_handle only on first reparent operation. (pinfo::wait): Don't set pid_handle here. (pinfo::alert_parent): Always try to send signal. If unsuccessful then close and zero wr_proc_pipe. * pinfo.h (pinfo::pinfo): Make sure that appropriate parts of the class are zeroed on construction. (pinfo::alert_parent): Take char argument. (pinfo_fixup_after_fork): Delete declaration. (hexec_proc): Ditto. * sigproc.cc (remove_proc): Close pid_handle and hProcess if appropriate. * spawn.cc (spawn_guts): Set cygheap->pid_handle on first exec.
Diffstat (limited to 'winsup/cygwin/sigproc.cc')
-rw-r--r--winsup/cygwin/sigproc.cc12
1 files changed, 9 insertions, 3 deletions
diff --git a/winsup/cygwin/sigproc.cc b/winsup/cygwin/sigproc.cc
index 041c880e786..844e80a2b84 100644
--- a/winsup/cygwin/sigproc.cc
+++ b/winsup/cygwin/sigproc.cc
@@ -303,8 +303,8 @@ proc_subproc (DWORD what, DWORD val)
*/
if ((wval->ev = wval->thread_ev) == NULL)
{
- wval->ev = wval->thread_ev = CreateEvent (&sec_none_nih, TRUE,
- FALSE, NULL);
+ wval->ev = wval->thread_ev = CreateEvent (&sec_none_nih, TRUE, FALSE,
+ NULL);
ProtectHandle1 (wval->ev, wq_ev);
}
@@ -765,7 +765,13 @@ remove_proc (int ci)
sigproc_printf ("removing procs[%d], pid %d, nprocs %d", ci, procs[ci]->pid,
nprocs);
if (procs[ci] != myself)
- procs[ci].release ();
+ {
+ procs[ci].release ();
+ if (procs[ci].pid_handle)
+ ForceCloseHandle1 (procs[ci].pid_handle, childhProc);
+ if (procs[ci].hProcess)
+ ForceCloseHandle1 (procs[ci].hProcess, childhProc);
+ }
if (ci < --nprocs)
procs[ci] = procs[nprocs];
return 0;