summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 0f7c2b6)
raw | patch | inline | side by side (parent: 0f7c2b6)
author | Andrés J. Díaz <ajdiaz@connectical.com> | |
Sat, 19 Sep 2009 06:45:49 +0000 (08:45 +0200) | ||
committer | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Sat, 19 Sep 2009 06:47:50 +0000 (08:47 +0200) |
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 <octo@leeloo.lan.home.verplant.org>
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 <octo@leeloo.lan.home.verplant.org>
src/processes.c | patch | blob | history |
diff --git a/src/processes.c b/src/processes.c
index fd06b21b4949d88cff169806d01abee98720ce03..4f515184ed85a66f38f17400f9f08dbca112fdb5 100644 (file)
--- a/src/processes.c
+++ b/src/processes.c
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;
}