From 10f007e07e90cd64ce322f7a1a7e4f9900ff7990 Mon Sep 17 00:00:00 2001 From: Hisham Muhammad Date: Sat, 20 Nov 2010 20:27:37 +0000 Subject: [PATCH] Fix for systems where there's no /proc/PID/task/PID/. Closes #2789634. --- ProcessList.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ProcessList.c b/ProcessList.c index a958055e..cd265361 100644 --- a/ProcessList.c +++ b/ProcessList.c @@ -532,6 +532,9 @@ static bool ProcessList_processEntries(ProcessList* this, const char* dirname, P int pid; // filename is a number: process directory pid = atoi(name); + + if (pid == parentPid) + continue; // The RedHat kernel hides threads with a dot. // I believe this is non-standard. @@ -571,8 +574,7 @@ static bool ProcessList_processEntries(ProcessList* this, const char* dirname, P char subdirname[MAX_NAME+1]; snprintf(subdirname, MAX_NAME, "%s/%s/task", dirname, name); - if (ProcessList_processEntries(this, subdirname, process, pid, period)) - continue; + ProcessList_processEntries(this, subdirname, process, pid, period); } #ifdef HAVE_TASKSTATS