processes: fix issue with stat no such file/dir (#8309)

This commit is contained in:
Steven Soroka 2020-10-26 11:35:10 -04:00 committed by GitHub
parent 0ec97a2bdd
commit 0e31020836
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 0 additions and 5 deletions

View File

@ -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
}
@ -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) {