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:
Jean Delvare committed 2006-09-01 21:34:56 +00:00
1 parent 22f74aa96e
commit 6ff8a21179
1 file changed
+10 -3
+10 -3
View File
@@ -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];