Skip to content

Commit

Permalink
Merge pull request #5 from ms140569/master
Browse files Browse the repository at this point in the history
Fixing #2
  • Loading branch information
mhausenblas committed May 11, 2020
2 parents 31879c1 + f7f778a commit 47bb463
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions namespaces/namespaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,12 @@ func lprocess(pid string) *Process {
func usage(pid string, cg string) (map[string]string, error) {
base := "/sys/fs/cgroup/"
p := lprocess(pid)

if p == nil {
fmt.Fprintln(os.Stderr, "PID not found.")
os.Exit(1)
}

cgroups := p.Cgroups
lines := strings.Split(cgroups, "\n")
for _, l := range lines {
Expand Down

0 comments on commit 47bb463

Please sign in to comment.