X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fprocesses.c;h=22d369df279c73ddccaf4489d586eb7eddd84d08;hb=83149d73b8a3bd4889517a2e4d0adca0a52e7a06;hp=29492ac2ff6347bb0427249056907ca947fa01d1;hpb=e4080f7aea79ffa3ad21fb2c8e6be311b1a404b9;p=collectd.git diff --git a/src/processes.c b/src/processes.c index 29492ac2..22d369df 100644 --- a/src/processes.c +++ b/src/processes.c @@ -510,11 +510,14 @@ static int *ps_read_tasks (int pid) closedir (dh); + if (list_len == 0) + return (NULL); + assert (list_len < list_size); assert (list[list_len] == 0); return (list); -} +} /* int *ps_read_tasks */ int ps_read_process (int pid, procstat_t *ps, char *state) { @@ -600,8 +603,8 @@ int ps_read_process (int pid, procstat_t *ps, char *state) /* Leave the rest at zero if this is only a zombi */ if (ps->num_proc == 0) { - DEBUG ("This is only a zombi: pid = %i; name = %s;", - pid, ps->name); + DEBUG ("processes plugin: This is only a zombi: pid = %i; " + "name = %s;", pid, ps->name); return (0); }