Commit 9acba539 authored by Leigh B Stoller's avatar Leigh B Stoller
Browse files

Minor change to dynamic load of device specific modules; watch for a

load error other then "not found", and report that rather then
continuing on without the module. This causes really obscure problems
that take a long time to figure out, especially with my old brain.
parent 2cac9b11
......@@ -292,9 +292,15 @@ sub NewType($$)
if ($@) {
$self->dprint(2,"NewType($type): simple module load failed: " . $@);
eval "require libosload_${type}";
if ($@) {
if ($@ !~ /Can't locate libosload_/) {
print STDERR "$self NewType($type): module load failed: " . $@;
}
return undef;
}
$newtype = eval { $packname->New($self); };
if ($@) {
$self->dprint(1,"$self NewType($type): module load failed: " . $@);
$self->dprint(1,"$self NewType($type): New() failed: " . $@);
return undef;
}
}
......
......@@ -974,10 +974,16 @@ sub NewType($$)
# Not loaded?
if ($@) {
#print STDERR "module load failed: " . $@ . "\n";
eval "require libossetup_" . $type;
eval "require libossetup_${type}";
if ($@) {
if ($@ !~ /Can't locate libossetup_/) {
print STDERR "$self NewType($type): module load failed: " . $@;
}
return undef;
}
$newtype = eval { $packname->New($self); };
if ($@) {
# print STDERR "$self NewType($type): module load failed: " . $@ . "\n"
# print STDERR "$self NewType($type): New() failed: " . $@ . "\n"
# if ($self->debug());
return undef;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment