mirror of
https://github.com/lm-sensors/lm-sensors.git
synced 2026-10-19 11:19:31 +00:00
Properly handle the case where the eeprom driver is not loaded.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@4132 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
1 parent
22f74aa96e
commit
6ff8a21179
1 file changed
+10
-3
@@ -1077,9 +1077,16 @@ Version 2.10.1';
|
||||
|
||||
|
||||
my $dimm_count=0;
|
||||
if ($use_sysfs) { $_=`ls /sys/bus/i2c/drivers/eeprom`; }
|
||||
else { $_=`ls /proc/sys/dev/sensors/`; }
|
||||
my @dimm_list=split();
|
||||
my @dimm_list;
|
||||
my $dir;
|
||||
if ($use_sysfs) { $dir = '/sys/bus/i2c/drivers/eeprom'; }
|
||||
else { $dir = '/proc/sys/dev/sensors'; }
|
||||
if (-d $dir) {
|
||||
@dimm_list = split(/\s+/, `ls $dir`);
|
||||
} elsif (! -d '/sys/module/eeprom') {
|
||||
print "No EEPROM found, are you sure the eeprom module is loaded?\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
for my $i ( 0 .. $#dimm_list ) {
|
||||
$_=$dimm_list[$i];
|
||||
|
||||
Reference in new issue
Block a user