Fix crash in tdehwlib if /sys/devices/system/cpu/cpu* is not accessible

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
(cherry picked from commit 051acc7df5)
pull/16/head
Slávek Banko 7 years ago
parent 03781b6f47
commit 7d83a0cb92

@ -862,11 +862,13 @@ void TDEHardwareDevices::processModifiedCPUs() {
if (modified) {
for (processorNumber=0; processorNumber<processorCount; processorNumber++) {
TDEGenericDevice* hwdevice = findCPUBySystemPath(TQString("/sys/devices/system/cpu/cpu%1").arg(processorNumber));
if (hwdevice) {
// Signal new information available
emit hardwareUpdated(hwdevice);
emit hardwareEvent(TDEHardwareEvent::HardwareUpdated, hwdevice->uniqueID());
}
}
}
#ifdef CPUPROFILING
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &time2);

Loading…
Cancel
Save