diff options
Diffstat (limited to 'goapps/captree/captree.go')
-rw-r--r-- | goapps/captree/captree.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/goapps/captree/captree.go b/goapps/captree/captree.go index 4c7a586..f6bdaa4 100644 --- a/goapps/captree/captree.go +++ b/goapps/captree/captree.go @@ -88,6 +88,7 @@ var ( type task struct { mu sync.Mutex + viewed bool pid string cmd string cap *cap.Set @@ -183,6 +184,13 @@ func rDump(pids map[string]*task, pid, stub, lstub, estub string, depth int) { fmt.Println("[PID:", pid, "not found]") return } + if info.viewed { + // This process (tree) has already been viewed so skip + // repeating it. + return + } + info.viewed = true + c := "" set := info.cap if set != nil { |