Skip to content

Commit b380dd4

Browse files
fix: thermal_zone, handle EINVAL errors from sysfs reads. (#763)
Signed-off-by: ccastiglione-reply <c.castiglione@reply.it>
1 parent 6128805 commit b380dd4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

sysfs/class_thermal.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ func (fs FS) ClassThermalZoneStats() ([]ClassThermalZoneStats, error) {
5050
for _, zone := range zones {
5151
zoneStats, err := parseClassThermalZone(zone)
5252
if err != nil {
53-
if errors.Is(err, syscall.ENODATA) || errors.As(err, new(*fsp.PathError)) || errors.Is(err, syscall.EAGAIN) {
53+
if errors.Is(err, syscall.ENODATA) || errors.As(err, new(*fsp.PathError)) || errors.Is(err, syscall.EAGAIN) ||
54+
errors.Is(err, syscall.EINVAL) {
5455
continue
5556
}
5657
return nil, err

0 commit comments

Comments
 (0)