Skip to content

Commit

Permalink
Merge pull request #436 from bobrik/ivan/ignore-enoent
Browse files Browse the repository at this point in the history
Ignore "no such file or directory" in cgroup walker
  • Loading branch information
bobrik committed Jun 20, 2024
2 parents 29de0a7 + ca938b0 commit 36ebae3
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 36ebae3

Please sign in to comment.