Skip to content

Commit

Permalink
Ignore "no such file or directory" in cgroup walker
Browse files Browse the repository at this point in the history
Closes #435
  • Loading branch information
bobrik committed Jun 20, 2024
1 parent 29de0a7 commit ca938b0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cgroup/walker.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package cgroup
import (
"io/fs"
"log"
"os"
"path/filepath"
)

Expand Down Expand Up @@ -49,6 +50,11 @@ func walk(dir string) (map[int]string, error) {

err := filepath.WalkDir(dir, func(path string, entry fs.DirEntry, err error) error {
if err != nil {
// Things can disappear from under us, that's fine
if os.IsNotExist(err) {
return nil
}

return err
}

Expand Down

0 comments on commit ca938b0

Please sign in to comment.