top: correct a flaw in the support for pids monitoring

Ever since top was adapted to the new <pids> interface
there has been a bug that would cause an abnormal exit
when the '-p' argument contained *no* valid pids. This
was never revealed until now since the QA folks tested
only with valid, existing pids. (bunch of morons, eh?)

And even though the program author is blameless he has
taken it upon himself to clean up after the QA jokers.

Signed-off-by: Jim Warner <james.warner@comcast.net>
This commit is contained in:
Jim Warner 2015-10-08 00:00:00 -05:00 committed by Craig Small
parent bc616b3615
commit 41e7510333

View File

@ -2248,7 +2248,7 @@ static void procs_refresh (void) {
#define nALGN2(n,m) ((n + m - 1) & ~(m - 1)) // with power of 2 align
#define n_reap Pids_reap->counts.total // maintained by newlib
static double uptime_sav;
static int n_alloc; // size of windows stacks arrays
static int n_alloc = -1; // size of windows stacks arrays
double uptime_cur;
float et;
int i;