Fix crash in tdehwlib if not exists /sys/devices/system/cpu

This resolves Bug 2584

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
pull/1/head
Slávek Banko 9 years ago
parent 6dfc04c51a
commit f4fb3a8e71

@ -3597,6 +3597,7 @@ void TDEHardwareDevices::addCoreSystemDevices() {
TQDir d("/sys/devices/system/cpu/"); TQDir d("/sys/devices/system/cpu/");
d.setFilter( TQDir::Dirs ); d.setFilter( TQDir::Dirs );
const TQFileInfoList *list = d.entryInfoList(); const TQFileInfoList *list = d.entryInfoList();
if (list) {
TQFileInfoListIterator it( *list ); TQFileInfoListIterator it( *list );
TQFileInfo *fi; TQFileInfo *fi;
while ((fi = it.current()) != 0) { while ((fi = it.current()) != 0) {
@ -3613,6 +3614,7 @@ void TDEHardwareDevices::addCoreSystemDevices() {
} }
++it; ++it;
} }
}
// Populate CPU information // Populate CPU information
processModifiedCPUs(); processModifiedCPUs();

Loading…
Cancel
Save