Skip to content

Commit 0b27a3a

Browse files
committed
Continue on EINVAL for sas_phy sysfs files
Signed-off-by: Brock Johnson <[email protected]>
1 parent 1cf8505 commit 0b27a3a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

sysfs/class_sas_phy.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,13 @@
1717
package sysfs
1818

1919
import (
20+
"errors"
2021
"fmt"
2122
"os"
2223
"path/filepath"
2324
"strconv"
2425
"strings"
26+
"syscall"
2527

2628
"github.com/prometheus/procfs/internal/util"
2729
)
@@ -97,7 +99,7 @@ func (fs FS) parseSASPhy(name string) (*SASPhy, error) {
9799
if fileinfo.Mode().IsRegular() {
98100
value, err := util.SysReadFile(name)
99101
if err != nil {
100-
if os.IsPermission(err) {
102+
if os.IsPermission(err) || errors.Is(err, syscall.EINVAL) {
101103
continue
102104
}
103105
return nil, fmt.Errorf("failed to read file %q: %w", name, err)

0 commit comments

Comments
 (0)