add some return values to some shit so it shuts down elegantly on crash
This commit is contained in:
@@ -65,14 +65,15 @@ void sys::getNetwork(Network* net, const std::string& device) {
|
||||
prev = current;
|
||||
}
|
||||
|
||||
void sys::detectHwmon(sysSensors* s, const std::string& platform) {
|
||||
int sys::detect(sysSensors* s, const std::string& platform) {
|
||||
// we dont really need getFirstDir since its a static folder, but its useful for try/catch
|
||||
try {
|
||||
s->hwmon = utils::getFirstDir("/sys/devices/platform/" + platform + "/hwmon");
|
||||
} catch (...) {
|
||||
applog(LOG::ERR, "Can't open sys hwmon. Module loaded? Kernel params added?");
|
||||
return;
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void sys::updateSensors(sysSensors* s) {
|
||||
|
||||
Reference in New Issue
Block a user