aboutsummaryrefslogtreecommitdiff
path: root/winsup
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2004-11-20 04:17:22 +0000
committerChristopher Faylor <me@cgf.cx>2004-11-20 04:17:22 +0000
commit3eccd89c424898c359dd65fc017566924be73dba (patch)
tree93faa9a5f9d7975953f3a853834e4aa0bf6be7c7 /winsup
parent2749c78414c0547062e6cd37cbdf57ef2e7fdccf (diff)
downloadnewlib-3eccd89c424898c359dd65fc017566924be73dba.zip
newlib-3eccd89c424898c359dd65fc017566924be73dba.tar.gz
newlib-3eccd89c424898c359dd65fc017566924be73dba.tar.bz2
unexperiment
Diffstat (limited to 'winsup')
-rw-r--r--winsup/cygwin/pinfo.cc28
-rw-r--r--winsup/cygwin/sigproc.cc10
2 files changed, 10 insertions, 28 deletions
diff --git a/winsup/cygwin/pinfo.cc b/winsup/cygwin/pinfo.cc
index b2f03bf..781df96 100644
--- a/winsup/cygwin/pinfo.cc
+++ b/winsup/cygwin/pinfo.cc
@@ -125,22 +125,18 @@ _pinfo::exit (UINT n, bool norecord)
if (this)
{
- if (!norecord)
- {
- 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. */
struct rusage r;
fill_rusage (&r, hMainProc);
add_rusage (&rusage_self, &r);
+
+ if (!norecord)
+ {
+ process_state = PID_EXITED;
+ if (wr_proc_pipe)
+ CloseHandle (wr_proc_pipe);
+ }
}
sigproc_printf ("Calling ExitProcess %d", n);
@@ -766,14 +762,6 @@ pinfo::wait ()
preserve ();
-#if 0
- DWORD tid;
- HANDLE h = CreateThread (&sec_none_nih, 0, proc_waiter, this, 0, &tid);
- if (!h)
- sigproc_printf ("tracking thread creation failed for pid %d", (*this)->pid);
- else
- CloseHandle (h);
-#else
cygthread *h = new cygthread (proc_waiter, this, "sig");
if (!h)
sigproc_printf ("tracking thread creation failed for pid %d", (*this)->pid);
@@ -783,7 +771,7 @@ pinfo::wait ()
sigproc_printf ("created tracking thread for pid %d, winpid %p, rd_pipe %p",
(*this)->pid, (*this)->dwProcessId, rd_proc_pipe);
}
-#endif
+
return 1;
}
diff --git a/winsup/cygwin/sigproc.cc b/winsup/cygwin/sigproc.cc
index 15ffbcf..8dc5597 100644
--- a/winsup/cygwin/sigproc.cc
+++ b/winsup/cygwin/sigproc.cc
@@ -274,13 +274,7 @@ proc_subproc (DWORD what, DWORD val)
vchild->cygstarted = true;
vchild->process_state |= PID_INITIALIZING | (myself->process_state & PID_USETTY);
procs[nprocs] = vchild;
- if (!CGFFAST)
- rc = procs[nprocs].wait ();
- else
- {
- procs[nprocs].preserve ();
- rc = 1;
- }
+ rc = procs[nprocs].wait ();
if (rc)
{
sigproc_printf ("added pid %d to proc table, slot %d", vchild->pid,
@@ -803,7 +797,7 @@ stopped_or_terminated (waitq *parent_w, _pinfo *child)
int terminated;
- if (!((terminated = (child->process_state == PID_ZOMBIE | child->process_state == PID_EXITED)) ||
+ if (!((terminated = (child->process_state == PID_ZOMBIE)) ||
((w->options & WUNTRACED) && child->stopsig)))
return 0;