Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2000-11-05 09:42:23 +0300
committerChristopher Faylor <me@cgf.cx>2000-11-05 09:42:23 +0300
commit0c9ae85d56f9bda2c53cbe3d9fad6aa9a042ad54 (patch)
treee36c194434cb5dcb138a52287393e33ec8ddd67a /winsup/cygwin/external.cc
parent7edb836a68620f50399b6d086ecba7c19d08b10f (diff)
* pinfo.cc (winpids:add): New method.
(winpids::enumNT): New method renamed from EnumProcessesNT. Use add method to add elements to the lists. (winpids::enum9x): New method renamed from EnumProcesses9x. Use add method to add elements to the lists. (winpids::enum_init): Accept 'winpid' parameter to control whether to add all windows pids to the list. (winpids::release): New method. * pinfo.h (winpids): Reflect above changes. * signal.cc (kill_pgrp): Ditto. * external.cc (fillout_pinfo): Ditto.
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);