Changeset 4132

Show
Ignore:
Timestamp:
09/01/06 23:34:56 (8 years ago)
Author:
khali
Message:

Properly handle the case where the eeprom driver is not loaded.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lm-sensors/trunk/prog/eeprom/decode-dimms.pl

    r3310 r4132  
    10781078 
    10791079my $dimm_count=0; 
    1080 if ($use_sysfs) { $_=`ls /sys/bus/i2c/drivers/eeprom`; } 
    1081 else { $_=`ls /proc/sys/dev/sensors/`; } 
    1082 my @dimm_list=split(); 
     1080my @dimm_list; 
     1081my $dir; 
     1082if ($use_sysfs) { $dir = '/sys/bus/i2c/drivers/eeprom'; } 
     1083else { $dir = '/proc/sys/dev/sensors'; } 
     1084if (-d $dir) { 
     1085        @dimm_list = split(/\s+/, `ls $dir`); 
     1086} elsif (! -d '/sys/module/eeprom') { 
     1087        print "No EEPROM found, are you sure the eeprom module is loaded?\n"; 
     1088        exit; 
     1089} 
    10831090 
    10841091for my $i ( 0 .. $#dimm_list ) {