aboutsummaryrefslogtreecommitdiff
path: root/winsup
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2004-11-16 06:24:44 +0000
committerChristopher Faylor <me@cgf.cx>2004-11-16 06:24:44 +0000
commit8a18cb9319d0d6f2b62883b2d1a11fbb50c11f23 (patch)
treea35cea82a40c53344bc536b5af0931eb88de5eb3 /winsup
parent406439ffc770eec92a7a55997501460063c3c124 (diff)
downloadnewlib-8a18cb9319d0d6f2b62883b2d1a11fbb50c11f23.zip
newlib-8a18cb9319d0d6f2b62883b2d1a11fbb50c11f23.tar.gz
newlib-8a18cb9319d0d6f2b62883b2d1a11fbb50c11f23.tar.bz2
guess ignoring SIGCHLD really is important.
Diffstat (limited to 'winsup')
-rw-r--r--winsup/cygwin/external.cc1
-rw-r--r--winsup/cygwin/sigproc.cc27
2 files changed, 14 insertions, 14 deletions
diff --git a/winsup/cygwin/external.cc b/winsup/cygwin/external.cc
index c0cad36..ab7a392 100644
--- a/winsup/cygwin/external.cc
+++ b/winsup/cygwin/external.cc
@@ -72,7 +72,6 @@ fillout_pinfo (pid_t pid, int winpid)
ep.ctty = p->ctty;
ep.pid = p->pid;
ep.ppid = p->ppid;
- ep.hProcess = p->hProcess;
ep.dwProcessId = p->dwProcessId;
ep.uid = p->uid;
ep.gid = p->gid;
diff --git a/winsup/cygwin/sigproc.cc b/winsup/cygwin/sigproc.cc
index 1ddb74e..54a0389 100644
--- a/winsup/cygwin/sigproc.cc
+++ b/winsup/cygwin/sigproc.cc
@@ -80,7 +80,7 @@ DWORD NO_COPY sigtid = 0; // ID of the signal thread
/* Function declarations */
static int __stdcall checkstate (waitq *) __attribute__ ((regparm (1)));
static __inline__ bool get_proc_lock (DWORD, DWORD);
-static void __stdcall remove_proc (int);
+static bool __stdcall remove_proc (int);
static bool __stdcall stopped_or_terminated (waitq *, _pinfo *);
static DWORD WINAPI wait_sig (VOID *arg);
@@ -364,9 +364,8 @@ proc_subproc (DWORD what, DWORD val)
// FIXMENOW: What is supposed to happen here?
if (global_sigs[SIGCHLD].sa_handler == (void *) SIG_IGN)
- while (nprocs)
- remove_proc (0);
- break;
+ for (int i = 0; i < nprocs; i += remove_proc (i))
+ continue;
}
out:
@@ -750,6 +749,7 @@ checkstate (waitq *parent_w)
goto out;
}
+ sigproc_printf ("no matching terminated children found");
potential_match = -!!nprocs;
out:
@@ -759,17 +759,18 @@ out:
/* Remove a proc from procs by swapping it with the last child in the list.
Also releases shared memory of exited processes. */
-static void __stdcall
+static bool __stdcall
remove_proc (int ci)
{
- if (!proc_exists (procs[ci]))
- {
- sigproc_printf ("removing procs[%d], pid %d, nprocs %d", ci, procs[ci]->pid,
- nprocs);
- procs[ci].release ();
- if (ci < --nprocs)
- procs[ci] = procs[nprocs];
- }
+ if (proc_exists (procs[ci]))
+ return true;
+
+ sigproc_printf ("removing procs[%d], pid %d, nprocs %d", ci, procs[ci]->pid,
+ nprocs);
+ procs[ci].release ();
+ if (ci < --nprocs)
+ procs[ci] = procs[nprocs];
+ return 0;
}
/* Check status of child process vs. waitq member.