summaryrefslogtreecommitdiffstats
path: root/ProcessList.c
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2010-11-24 01:02:29 +0000
committerHisham Muhammad <hisham@gobolinux.org>2010-11-24 01:02:29 +0000
commit941ad72f674edff8e202e73ef837cea9c9d46411 (patch)
treefc289bc03b5ad16caf8639d9c32e1459605993c7 /ProcessList.c
parent831538b0f90a2ae6448522dc6c0bbcb73ba12f97 (diff)
correct thread detection
Diffstat (limited to 'ProcessList.c')
-rw-r--r--ProcessList.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/ProcessList.c b/ProcessList.c
index d94a3fcc..5cc448cb 100644
--- a/ProcessList.c
+++ b/ProcessList.c
@@ -557,13 +557,10 @@ static bool ProcessList_processEntries(ProcessList* this, const char* dirname, P
if (parent && pid == parent->pid)
continue;
- bool isThread = parent;
// The RedHat kernel hides threads with a dot.
// I believe this is non-standard.
if ((!this->hideThreads) && pid == 0 && name[0] == '.') {
- char* tname = name + 1;
- pid = atoi(tname);
- isThread = true;
+ pid = atoi(name + 1);
}
if (pid <= 0)
continue;
@@ -593,7 +590,6 @@ static bool ProcessList_processEntries(ProcessList* this, const char* dirname, P
if (! ProcessList_readStatmFile(process, dirname, name))
goto errorReadingProcess;
- isThread = Process_isThread(process);
process->show = ! ((hideKernelThreads && Process_isKernelThread(process)) || (hideUserlandThreads && Process_isUserlandThread(process)));
char command[MAX_NAME+1];
@@ -629,7 +625,7 @@ static bool ProcessList_processEntries(ProcessList* this, const char* dirname, P
ProcessList_add(this, process);
}
- if (isThread) {
+ if (Process_isThread(process)) {
if (this->showThreadNames || Process_isKernelThread(process) || process->state == 'Z') {
free(process->comm);
process->comm = String_copy(command);

© 2014-2024 Faster IT GmbH | imprint | privacy policy