mirror of
https://github.com/henrygd/beszel.git
synced 2026-04-10 23:11:50 +02:00
fix(agent): add safety check for read returning negative bytes (#1799)
This commit is contained in:
@@ -156,6 +156,7 @@ func (gm *GPUManager) updateAmdGpuData(cardPath string) bool {
|
||||
func readSysfsFloat(path string) (float64, error) {
|
||||
val, err := utils.ReadStringFileLimited(path, 64)
|
||||
if err != nil {
|
||||
slog.Debug("Failed to read sysfs value", "path", path, "error", err)
|
||||
return 0, err
|
||||
}
|
||||
return strconv.ParseFloat(val, 64)
|
||||
|
||||
Reference in New Issue
Block a user