Commit b1a2e02b authored by Micha Mueller's avatar Micha Mueller
Browse files

2 bugfixes (IPMI): take return value of ipmi_sensor_read into account; close...

2 bugfixes (IPMI): take return value of ipmi_sensor_read into account; close sdrCache + ipmi-connection after reading
parent cdd5844b
......@@ -209,11 +209,15 @@ uint64_t IPMIHost::readSensor_recordId(uint16_t recordId) {
return 0;
}
if (ipmi_sensor_read(_sensorReadCtx, record, recordLength, 0, &rawReading, &reading, &eventBitmask)) {
if (ipmi_sensor_read(_sensorReadCtx, record, recordLength, 0, &rawReading, &reading, &eventBitmask) < 0) {
increaseErrorCount();
throw std::runtime_error("freeipmi Error: " + std::string(ipmi_sensor_read_ctx_errormsg(_sensorReadCtx)));
return 0;
}
destroySdrCache();
disconnect();
return *reading;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment