From: Florian Forster Date: Tue, 22 May 2007 15:54:54 +0000 (+0200) Subject: Merge branch 'collectd-3.11' X-Git-Tag: collectd-4.0.0~7^2~2 X-Git-Url: https://git.octo.it/?a=commitdiff_plain;h=5afa2f82d43e2a7952d8f347f6f40b5778c59db8;p=collectd.git Merge branch 'collectd-3.11' Conflicts: src/processes.c --- 5afa2f82d43e2a7952d8f347f6f40b5778c59db8 diff --cc src/processes.c index 5a29236d,ccf1571f..ff401266 --- a/src/processes.c +++ b/src/processes.c @@@ -584,17 -708,21 +584,21 @@@ int ps_read_process (int pid, procstat_ ppid = atoi (fields[3]); - if ((tasks = ps_read_tasks (pid)) == NULL) - *state = fields[2][0]; - - if (*state == 'Z') - { - ps->num_lwp = 0; - ps->num_proc = 0; - } - else if ((tasks = ps_read_tasks (pid)) == NULL) - { - /* Kernel 2.4 or so */ - ps->num_lwp = 1; - ps->num_proc = 1; - } ++ *state = fields[2][0]; ++ ++ if (*state == 'Z') + { - /* This happends for zombied, e.g. */ - DEBUG ("ps_read_tasks (%i) failed.", pid); - *state = 'Z'; + ps->num_lwp = 0; + ps->num_proc = 0; + } ++ else if ((tasks = ps_read_tasks (pid)) == NULL) ++ { ++ /* Kernel 2.4 or so */ ++ ps->num_lwp = 1; ++ ps->num_proc = 1; ++ } else { - *state = '\0'; ps->num_lwp = 0; ps->num_proc = 1; for (i = 0; tasks[i] != 0; i++) @@@ -604,10 -732,10 +608,10 @@@ tasks = NULL; } - /* Leave the rest at zero if this is only an LWP */ - /* Leave the rest at zero if this is only a zombi */ ++ /* Leave the rest at zero if this is only a zombi */ if (ps->num_proc == 0) { - DEBUG ("This is only an LWP: pid = %i; name = %s;", - DBG ("This is only a zombi: pid = %i; name = %s;", ++ DEBUG ("This is only a zombi: pid = %i; name = %s;", pid, ps->name); return (0); }