summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <cgf@redhat.com>2004-11-20 02:56:34 +0000
committerChristopher Faylor <cgf@redhat.com>2004-11-20 02:56:34 +0000
commit44e23aaa8426e878c98e48706f1bd2b85ecd4656 (patch)
treeec3f6b4fb272c3cb085edc89e9c402c674da9724
parente1b11ebe60ac25d5c9f92c239f75c493d0b2bf3a (diff)
downloadgdb-44e23aaa8426e878c98e48706f1bd2b85ecd4656.tar.gz
experiment
-rw-r--r--winsup/cygwin/pinfo.cc11
-rw-r--r--winsup/cygwin/sigproc.cc10
2 files changed, 18 insertions, 3 deletions
diff --git a/winsup/cygwin/pinfo.cc b/winsup/cygwin/pinfo.cc
index 1d78d5a845c..b2f03bf2c6c 100644
--- a/winsup/cygwin/pinfo.cc
+++ b/winsup/cygwin/pinfo.cc
@@ -122,10 +122,19 @@ _pinfo::exit (UINT n, bool norecord)
sigproc_terminate ();
else
exitcode = n;
+
if (this)
{
if (!norecord)
- process_state = PID_EXITED;
+ {
+ process_state = PID_EXITED;
+ if (CGFFAST && myself->ppid != 1)
+ {
+ pinfo parent (myself->ppid);
+ if (parent)
+ sig_send (parent, SIGCHLD);
+ }
+ }
/* FIXME: There is a potential race between an execed process and its
parent here. I hated to add a mutex just for this, though. */
diff --git a/winsup/cygwin/sigproc.cc b/winsup/cygwin/sigproc.cc
index 8ac611c19f6..15ffbcfef7d 100644
--- a/winsup/cygwin/sigproc.cc
+++ b/winsup/cygwin/sigproc.cc
@@ -274,7 +274,13 @@ proc_subproc (DWORD what, DWORD val)
vchild->cygstarted = true;
vchild->process_state |= PID_INITIALIZING | (myself->process_state & PID_USETTY);
procs[nprocs] = vchild;
- rc = procs[nprocs].wait ();
+ if (!CGFFAST)
+ rc = procs[nprocs].wait ();
+ else
+ {
+ procs[nprocs].preserve ();
+ rc = 1;
+ }
if (rc)
{
sigproc_printf ("added pid %d to proc table, slot %d", vchild->pid,
@@ -797,7 +803,7 @@ stopped_or_terminated (waitq *parent_w, _pinfo *child)
int terminated;
- if (!((terminated = child->process_state == PID_ZOMBIE) ||
+ if (!((terminated = (child->process_state == PID_ZOMBIE | child->process_state == PID_EXITED)) ||
((w->options & WUNTRACED) && child->stopsig)))
return 0;