LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File smartmontools-scsi-temperature-check.patch of Package smartmontools (Project home:sbrabec:branches:smartmontools-1047198)

Index: smartmontools-6.5/ChangeLog
===================================================================
--- smartmontools-6.5.orig/ChangeLog
+++ smartmontools-6.5/ChangeLog
@@ -4,6 +4,7 @@ $Id: ChangeLog 4318 2016-05-07 11:18:20Z
 
 	smartd.cpp: Always suppress "failed to read Temperature" message
 	if SCSI device does not support temperature (ticket #817).
+	Fix initial check for SCSI temperature support.
 
 2016-05-07  Christian Franke  <franke@computer.org>
 
Index: smartmontools-6.5/smartd.cpp
===================================================================
--- smartmontools-6.5.orig/smartd.cpp
+++ smartmontools-6.5/smartd.cpp
@@ -2345,11 +2345,12 @@ static int SCSIDeviceScan(dev_config & c
                     &asc, &ascq, &currenttemp, &triptemp)) {
       PrintOut(LOG_INFO, "Device: %s, unexpectedly failed to read SMART values\n", device);
       state.SuppressReport = 1;
-      if (cfg.tempdiff || cfg.tempinfo || cfg.tempcrit) {
-        PrintOut(LOG_INFO, "Device: %s, can't monitor Temperature, ignoring -W %d,%d,%d\n",
-                 device, cfg.tempdiff, cfg.tempinfo, cfg.tempcrit);
-        cfg.tempdiff = cfg.tempinfo = cfg.tempcrit = 0;
-      }
+    }
+    if (   (state.SuppressReport || !currenttemp)
+        && (cfg.tempdiff || cfg.tempinfo || cfg.tempcrit)) {
+      PrintOut(LOG_INFO, "Device: %s, can't monitor Temperature, ignoring -W %d,%d,%d\n",
+               device, cfg.tempdiff, cfg.tempinfo, cfg.tempcrit);
+      cfg.tempdiff = cfg.tempinfo = cfg.tempcrit = 0;
     }
   }