Commit 10f007e0 authored by Hisham Muhammad's avatar Hisham Muhammad
Browse files

Fix for systems where there's no /proc/PID/task/PID/. Closes #2789634.

parent 0ff54eba
...@@ -532,6 +532,9 @@ static bool ProcessList_processEntries(ProcessList* this, const char* dirname, P ...@@ -532,6 +532,9 @@ static bool ProcessList_processEntries(ProcessList* this, const char* dirname, P
int pid; int pid;
// filename is a number: process directory // filename is a number: process directory
pid = atoi(name); pid = atoi(name);
if (pid == parentPid)
continue;
// The RedHat kernel hides threads with a dot. // The RedHat kernel hides threads with a dot.
// I believe this is non-standard. // I believe this is non-standard.
...@@ -571,8 +574,7 @@ static bool ProcessList_processEntries(ProcessList* this, const char* dirname, P ...@@ -571,8 +574,7 @@ static bool ProcessList_processEntries(ProcessList* this, const char* dirname, P
char subdirname[MAX_NAME+1]; char subdirname[MAX_NAME+1];
snprintf(subdirname, MAX_NAME, "%s/%s/task", dirname, name); snprintf(subdirname, MAX_NAME, "%s/%s/task", dirname, name);
if (ProcessList_processEntries(this, subdirname, process, pid, period)) ProcessList_processEntries(this, subdirname, process, pid, period);
continue;
} }
#ifdef HAVE_TASKSTATS #ifdef HAVE_TASKSTATS
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment