Skip to content

Commit

Permalink
processes: fix issue with stat no such file/dir (influxdata#8309)
Browse files Browse the repository at this point in the history
  • Loading branch information
ssoroka authored Oct 26, 2020
1 parent ec7a3fe commit 5e6c1f2
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions plugins/inputs/processes/processes_notwindows.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ func (p *Processes) gatherFromPS(fields map[string]interface{}) error {
// get process states from /proc/(pid)/stat files
func (p *Processes) gatherFromProc(fields map[string]interface{}) error {
filenames, err := filepath.Glob(linux_sysctl_fs.GetHostProc() + "/[0-9]*/stat")

if err != nil {
return err
}
Expand Down Expand Up @@ -192,10 +191,6 @@ func (p *Processes) gatherFromProc(fields map[string]interface{}) error {
}

func readProcFile(filename string) ([]byte, error) {
_, err := os.Stat(filename)
if err != nil {
return nil, err
}
data, err := ioutil.ReadFile(filename)
if err != nil {
if os.IsNotExist(err) {
Expand Down

0 comments on commit 5e6c1f2

Please sign in to comment.