mirror of
https://github.com/xzeldon/htop.git
synced 2024-12-23 22:55:46 +00:00
ProcessList: fix treeview on OpenBSD when hiding kernel threads
Currently the tree-view is empty on OpenBSD when kernel threads are hidden, cause the kernel thread 'swapper' has pid 0 and gets treated as root of the tree and parent of 'init'. Do not build any tree with a pid 0 root node.
This commit is contained in:
parent
70fecb4984
commit
58ad020aca
@ -311,6 +311,11 @@ static void ProcessList_updateTreeSet(ProcessList* this) {
|
||||
}
|
||||
|
||||
static void ProcessList_buildTreeBranch(ProcessList* this, pid_t pid, int level, int indent, int direction, bool show, int* node_counter, int* node_index) {
|
||||
// On OpenBSD the kernel thread 'swapper' has pid 0.
|
||||
// Do not treat it as root of any tree.
|
||||
if (pid == 0)
|
||||
return;
|
||||
|
||||
Vector* children = Vector_new(Class(Process), false, DEFAULT_SIZE);
|
||||
|
||||
for (int i = Vector_size(this->processes) - 1; i >= 0; i--) {
|
||||
|
Loading…
Reference in New Issue
Block a user