summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/external.cc
diff options
context:
space:
mode:
Diffstat (limited to 'winsup/cygwin/external.cc')
-rw-r--r--winsup/cygwin/external.cc13
1 files changed, 6 insertions, 7 deletions
diff --git a/winsup/cygwin/external.cc b/winsup/cygwin/external.cc
index 0623911d5..0199aedd3 100644
--- a/winsup/cygwin/external.cc
+++ b/winsup/cygwin/external.cc
@@ -32,23 +32,22 @@ fillout_pinfo (pid_t pid, int winpid)
static winpids pids (0);
if (!pids.npids || !nextpid)
- pids.init ();
+ pids.init (winpid);
static unsigned int i = 0;
if (!pid)
i = 0;
memset (&ep, 0, sizeof ep);
- for (; i < pids.npids;)
+ while (i < pids.npids)
{
- DWORD thispid = pids[i++];
- if (!thispid)
- continue;
- pinfo p (thispid, PID_NOREDIR);
+ DWORD thispid = pids.winpid (i);
+ _pinfo *p = pids[i];
+ i++;
if (!p)
{
- if (!winpid || (!nextpid && thispid != (DWORD) pid))
+ if (!nextpid && thispid != (DWORD) pid)
continue;
ep.pid = thispid;
ep.dwProcessId = cygwin_pid (thispid);