Fix fs error handling

This commit is contained in:
Daniel
2022-10-11 14:49:06 +02:00
parent b53b77e28c
commit 1144ac589b
8 changed files with 25 additions and 16 deletions

View File

@@ -3,7 +3,9 @@
package proc
import (
"errors"
"fmt"
"io/fs"
"os"
"strconv"
"sync"
@@ -50,7 +52,7 @@ func updatePids() {
statData, err := os.Stat(fmt.Sprintf("/proc/%d", pid))
if err != nil {
if !os.IsNotExist(err) {
if !errors.Is(err, fs.ErrNotExist) {
log.Warningf("proc: could not stat /proc/%d: %s", pid, err)
}
continue entryLoop