diff options
author | Christopher Faylor <me@cgf.cx> | 2000-11-05 06:42:23 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2000-11-05 06:42:23 +0000 |
commit | 0c9ae85d56f9bda2c53cbe3d9fad6aa9a042ad54 (patch) | |
tree | e36c194434cb5dcb138a52287393e33ec8ddd67a /winsup/cygwin/external.cc | |
parent | 7edb836a68620f50399b6d086ecba7c19d08b10f (diff) | |
download | newlib-0c9ae85d56f9bda2c53cbe3d9fad6aa9a042ad54.zip newlib-0c9ae85d56f9bda2c53cbe3d9fad6aa9a042ad54.tar.gz newlib-0c9ae85d56f9bda2c53cbe3d9fad6aa9a042ad54.tar.bz2 |
* 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.cc | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/winsup/cygwin/external.cc b/winsup/cygwin/external.cc index 0623911..0199aed 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); |