summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrare-magma <nun0@posteo.co>2022-06-07 22:25:17 +0200
committerrare-magma <nun0@posteo.co>2022-06-07 22:25:17 +0200
commit7f90fef35466c20860ab171a279d9a4cb98d84b6 (patch)
tree53524a1849beeed424fe199c60df5ebf67742f90
parent6a979718dcf23dfd910e595a2968c50a8ca1bea4 (diff)
close smart stream after reading temperature
-rw-r--r--devices/temp_nix.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/devices/temp_nix.go b/devices/temp_nix.go
index b4ef681..70cf91c 100644
--- a/devices/temp_nix.go
+++ b/devices/temp_nix.go
@@ -51,11 +51,13 @@ func getTemps(temps map[string]int) map[string]error {
for _, attr := range data.Attrs {
if attr.Id == 194 {
temps[disk.Name+"_"+disk.Model] = int(attr.Value)
+ sm.Close()
}
}
case *smart.NVMeDevice:
data, _ := sm.ReadSMART()
temps[disk.Name+"_"+disk.Model] = int(data.Temperature)
+ sm.Close()
default:
}
}