Skip to content

Commit

Permalink
Merge pull request #1344 from BishopFox/fix/pstree
Browse files Browse the repository at this point in the history
Fix pstree
  • Loading branch information
rkervella authored Jul 11, 2023
2 parents c17c378 + 853a7ab commit f2a3915
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions client/command/processes/pstree.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,16 @@ func (n *node) insert(proc *commonpb.Process) {
}

func (n *node) findParent(proc *commonpb.Process) *node {
// Empty node
if n.Value == nil {
return nil
}
// Skip self when called from reorder
// otherwise things might explode, see #1340
if n.Value.Pid == proc.Pid {
return nil
}
// Found parent
if n.Value.Pid == proc.Ppid {
return n
}
Expand Down

0 comments on commit f2a3915

Please sign in to comment.