From 0c9ae85d56f9bda2c53cbe3d9fad6aa9a042ad54 Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Sun, 5 Nov 2000 06:42:23 +0000 Subject: * 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. --- winsup/cygwin/external.cc | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'winsup/cygwin/external.cc') 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); -- cgit v1.2.3