From 858f5249178e01ca9a2ca375158a8633f20a4f3a Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Wed, 13 Sep 2000 02:35:05 +0000 Subject: * external.cc (fillout_pinfo): Handle explicit pids correctly. --- winsup/cygwin/external.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'winsup/cygwin/external.cc') diff --git a/winsup/cygwin/external.cc b/winsup/cygwin/external.cc index 74b106959..1bd86f5da 100644 --- a/winsup/cygwin/external.cc +++ b/winsup/cygwin/external.cc @@ -31,7 +31,7 @@ fillout_pinfo (pid_t pid, int winpid) static winpids pids (0); - if (!pids.npids) + if (!pids.npids || !nextpid) pids.init (); static unsigned int i = 0; @@ -48,14 +48,14 @@ fillout_pinfo (pid_t pid, int winpid) if (!p) { - if (!winpid) + if (!winpid || (!nextpid && thispid != pid)) continue; ep.pid = thispid; ep.dwProcessId = cygwin_pid (thispid); ep.process_state = PID_IN_USE; ep.ctty = -1; } - else if (p->pid) + else if (nextpid || p->pid == pid) { ep.ctty = tty_attached (p) ? p->ctty : -1; ep.pid = p->pid; -- cgit v1.2.3