summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/spawn.cc
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2004-12-06 00:29:41 +0000
committerChristopher Faylor <me@cgf.cx>2004-12-06 00:29:41 +0000
commit8c43a9f82e078662b70a1777f232edd7b37dfa02 (patch)
tree3b291a9542f6cf4ab3b13c76f0777e3023e7f4be /winsup/cygwin/spawn.cc
parent013f043fff95d2f456f97b81cd3bd4ee02000cc0 (diff)
downloadcygnal-8c43a9f82e078662b70a1777f232edd7b37dfa02.tar.gz
cygnal-8c43a9f82e078662b70a1777f232edd7b37dfa02.tar.bz2
cygnal-8c43a9f82e078662b70a1777f232edd7b37dfa02.zip
* fork.cc (fork_parent): Reinstate "childhProc" protection. Don't close
hProcess handle here since it is used to ensure that a new process isn't created with the old pid after the old pid exits. * spawn.cc (spawn_guts): Ditto. * pinfo.cc (proc_waiter): Don't send any signals if we've execed since this process doesn't officially exist. * pinfo.h (pinfo::pid_handle): Eliminate. Just use hProc. * sigproc.cc (sig_send): Don't send any signals if our sendsig doesn't exist. That's a sign that we are execing. (remove_proc): Eliminate pid_handle close.
Diffstat (limited to 'winsup/cygwin/spawn.cc')
-rw-r--r--winsup/cygwin/spawn.cc5
1 files changed, 1 insertions, 4 deletions
diff --git a/winsup/cygwin/spawn.cc b/winsup/cygwin/spawn.cc
index b161b987a..f0187e23b 100644
--- a/winsup/cygwin/spawn.cc
+++ b/winsup/cygwin/spawn.cc
@@ -784,7 +784,7 @@ spawn_guts (const char * prog_arg, const char *const *argv,
rc ? cygpid : (unsigned int) -1, prog_arg, one_line.buf);
/* Name the handle similarly to proc_subproc. */
- ProtectHandle (pi.hProcess);
+ ProtectHandle1 (pi.hProcess, childhProc);
bool wait_for_myself = false;
if (mode == _P_OVERLAY)
@@ -802,7 +802,6 @@ spawn_guts (const char * prog_arg, const char *const *argv,
this). */
if (!myself->wr_proc_pipe)
{
- myself.hProcess = pi.hProcess;
myself.remember ();
wait_for_myself = true;
myself->wr_proc_pipe = INVALID_HANDLE_VALUE;
@@ -855,8 +854,6 @@ if (wait_for_myself)
else
ciresrv.sync (myself, INFINITE);
-ForceCloseHandle (pi.hProcess);
-
switch (mode)
{
case _P_OVERLAY: