Top processes have no parent
parent
aa7e6c7e3b
commit
c1a0bd7bfb
|
@ -91,7 +91,6 @@ fn handle_tasks(processes: &mut HashMap<pid_t, ProcessItem>) -> Vec<pid_t> {
|
||||||
if let Some(p) = processes.get_mut(&parent) {
|
if let Some(p) = processes.get_mut(&parent) {
|
||||||
p.tasks.push(pid);
|
p.tasks.push(pid);
|
||||||
} else {
|
} else {
|
||||||
println!("no parent for {}", pid);
|
|
||||||
top.push(pid);
|
top.push(pid);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -354,7 +353,12 @@ impl ProcessesTrait for Processes {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fn parent(&self, index: usize) -> Option<usize> {
|
fn parent(&self, index: usize) -> Option<usize> {
|
||||||
self.get(index).process.parent.map(|pid| pid as usize)
|
let pid = index as pid_t;
|
||||||
|
if self.p.top.contains(&pid) {
|
||||||
|
None
|
||||||
|
} else {
|
||||||
|
self.get(index).process.parent.map(|pid| pid as usize)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
fn can_fetch_more(&self, index: Option<usize>) -> bool {
|
fn can_fetch_more(&self, index: Option<usize>) -> bool {
|
||||||
if index.is_some() || !self.active {
|
if index.is_some() || !self.active {
|
||||||
|
|
Loading…
Reference in New Issue