failure to get OCC temp 0
Failure to get OCC temp 0 as a (temperature is no longer available)
instead code gets a file read error with errno = 11 (Resource
temporarily unavailable). This will indicate temp is no longer
available 0 for Fan Control.
Tested: HW error inject on DIMM to cause OCC to send a temp 0 to BMC.
Signed-off-by: Sheldon Bailey <baileysh@us.ibm.com>
Change-Id: I64e5b0fddcabe82e4642e9a3d2eae3232149d51f
diff --git a/occ_manager.cpp b/occ_manager.cpp
index 0e6fb8d..72d7ada 100644
--- a/occ_manager.cpp
+++ b/occ_manager.cpp
@@ -852,7 +852,20 @@
fmt::format("readTempSensors: Failed reading {}, errno = {}",
filePathString + inputSuffix, e.code().value())
.c_str());
- continue;
+
+ // if errno == EAGAIN(Resource temporarily unavailable) then set
+ // temp to 0, to avoid using old temp, and affecting FAN Control.
+ if (e.code().value() == EAGAIN)
+ {
+ tempValue = 0;
+ }
+ // else the errno would be something like
+ // EBADF(Bad file descriptor)
+ // or ENOENT(No such file or directory)
+ else
+ {
+ continue;
+ }
}
dbus::OccDBusSensors::getOccDBus().setValue(