From e75f137bdc3f6a002a8b31d822f7732e191c0f2b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Andr=C3=A9s=20J=2E=20D=C3=ADaz?= Date: Sat, 19 Sep 2009 08:45:49 +0200 Subject: [PATCH] processes plugin: Fix handling of Linux 2.4. Hi Florian et al Thanks for the reply, but we detect a minor bug in the previous patch due to kernel 2.4 The correct patch is attached. The bug is related with kernels 2.4, where task/ directory do not exists and ps_read_task return -1, which is catched and raise an error (breaking the ps_read_process function), so a NaN is dispatched istead of values (number of process:1, number of threads :1). Sorry for the inconvenience :( Regards, Andres Signed-off-by: Florian Forster --- src/processes.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/processes.c b/src/processes.c index fd06b21b..4f515184 100644 --- a/src/processes.c +++ b/src/processes.c @@ -704,7 +704,10 @@ int ps_read_process (int pid, procstat_t *ps, char *state) else { if ( (ps->num_lwp = ps_read_tasks (pid)) == -1 ) - return (-1); + { + /* returns -1 => kernel 2.4 */ + ps->num_lwp = 1; + } ps->num_proc = 1; } -- 2.11.0