mirror of
https://github.com/lm-sensors/lm-sensors
synced 2025-08-31 14:25:39 +00:00
Avoid unwanted sensors-detect termination when /dev/port is missing
Patch from Jaromir Capik. The device file /dev/port might be missing in some cases and the sensors detection is terminated when the user tries to detect sensors dependent on it's existence. That's not correct -> it's not a reason for terminating the detection.
This commit is contained in:
1
CHANGES
1
CHANGES
@@ -8,6 +8,7 @@ SVN HEAD
|
|||||||
Map IT8771E, IT8772E, IT8782F and IT8783F to it87
|
Map IT8771E, IT8772E, IT8782F and IT8783F to it87
|
||||||
Use /sys/module instead of /proc/modules where available
|
Use /sys/module instead of /proc/modules where available
|
||||||
Drop legacy sysconfig configuration file syntax
|
Drop legacy sysconfig configuration file syntax
|
||||||
|
Stay alive when /dev/port is missing
|
||||||
|
|
||||||
3.3.3 "Happy Birthday Sophie" (2012-11-06)
|
3.3.3 "Happy Birthday Sophie" (2012-11-06)
|
||||||
documentation: Update fan-divisors, fan divisors are optional
|
documentation: Update fan-divisors, fan divisors are optional
|
||||||
|
@@ -2471,9 +2471,12 @@ sub overlay_hash
|
|||||||
|
|
||||||
sub initialize_ioports
|
sub initialize_ioports
|
||||||
{
|
{
|
||||||
sysopen(IOPORTS, "/dev/port", O_RDWR)
|
if (sysopen(IOPORTS, "/dev/port", O_RDWR)) {
|
||||||
or die "/dev/port: $!\n";
|
binmode(IOPORTS);
|
||||||
binmode(IOPORTS);
|
return 1;
|
||||||
|
}
|
||||||
|
print STDERR "/dev/port: $!\n";
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
sub close_ioports
|
sub close_ioports
|
||||||
@@ -3511,13 +3514,14 @@ sub find_aliases
|
|||||||
print("Can't set I2C address for $dev\n"),
|
print("Can't set I2C address for $dev\n"),
|
||||||
next;
|
next;
|
||||||
|
|
||||||
initialize_ioports();
|
if (initialize_ioports()) {
|
||||||
$alias_detect = $detected->[$isa]->{alias_detect};
|
$alias_detect = $detected->[$isa]->{alias_detect};
|
||||||
$is_alias = &$alias_detect($detected->[$isa]->{isa_addr},
|
$is_alias = &$alias_detect($detected->[$isa]->{isa_addr},
|
||||||
\*FILE,
|
\*FILE,
|
||||||
$detected->[$i2c]->{i2c_addr});
|
$detected->[$i2c]->{i2c_addr});
|
||||||
|
close_ioports();
|
||||||
|
}
|
||||||
close(FILE);
|
close(FILE);
|
||||||
close_ioports();
|
|
||||||
|
|
||||||
next unless $is_alias;
|
next unless $is_alias;
|
||||||
# This is an alias: copy the I2C data into the ISA
|
# This is an alias: copy the I2C data into the ISA
|
||||||
@@ -6819,10 +6823,11 @@ sub main
|
|||||||
"standard I/O ports to probe them. This is usually safe.\n";
|
"standard I/O ports to probe them. This is usually safe.\n";
|
||||||
print "Do you want to scan for Super I/O sensors? (YES/no): ";
|
print "Do you want to scan for Super I/O sensors? (YES/no): ";
|
||||||
unless (<STDIN> =~ /^\s*n/i) {
|
unless (<STDIN> =~ /^\s*n/i) {
|
||||||
initialize_ioports();
|
if (initialize_ioports()) {
|
||||||
$superio_features |= scan_superio(0x2e, 0x2f);
|
$superio_features |= scan_superio(0x2e, 0x2f);
|
||||||
$superio_features |= scan_superio(0x4e, 0x4f);
|
$superio_features |= scan_superio(0x4e, 0x4f);
|
||||||
close_ioports();
|
close_ioports();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
print "\n";
|
print "\n";
|
||||||
|
|
||||||
@@ -6835,9 +6840,10 @@ sub main
|
|||||||
"interfaces? (YES/no): ";
|
"interfaces? (YES/no): ";
|
||||||
unless (<STDIN> =~ /^\s*n/i) {
|
unless (<STDIN> =~ /^\s*n/i) {
|
||||||
if (!ipmi_from_smbios()) {
|
if (!ipmi_from_smbios()) {
|
||||||
initialize_ioports();
|
if (initialize_ioports()) {
|
||||||
scan_isa_bus(\@ipmi_ifs);
|
scan_isa_bus(\@ipmi_ifs);
|
||||||
close_ioports();
|
close_ioports();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
print "\n";
|
print "\n";
|
||||||
@@ -6851,9 +6857,10 @@ sub main
|
|||||||
$input = <STDIN>;
|
$input = <STDIN>;
|
||||||
unless ($input =~ /^\s*n/i
|
unless ($input =~ /^\s*n/i
|
||||||
|| ($superio_features && $input !~ /^\s*y/i)) {
|
|| ($superio_features && $input !~ /^\s*y/i)) {
|
||||||
initialize_ioports();
|
if (initialize_ioports()) {
|
||||||
scan_isa_bus(\@chip_ids);
|
scan_isa_bus(\@chip_ids);
|
||||||
close_ioports();
|
close_ioports();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
print "\n";
|
print "\n";
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user