mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-20 04:01:26 +00:00
SCST.pm: Do not cache the driver list
Signed-off-by: Eugene Apollonsky <apollonskiy.E@raidix.com> git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6549 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
@@ -542,28 +542,26 @@ sub setScstAttribute {
|
||||
SCST_C_ATTRIBUTE_STATIC);
|
||||
}
|
||||
|
||||
my @_drivers;
|
||||
sub drivers {
|
||||
my $self = shift;
|
||||
my $dHandle = new IO::Handle;
|
||||
my $_path = SCST_TARGETS_DIR();
|
||||
my @drivers;
|
||||
|
||||
if (!@_drivers) {
|
||||
my $dHandle = new IO::Handle;
|
||||
my $_path = SCST_TARGETS_DIR();
|
||||
if (opendir $dHandle, $_path) {
|
||||
foreach my $driver (readdir($dHandle)) {
|
||||
next if (($driver eq '.') || ($driver eq '..'));
|
||||
if (opendir($dHandle, $_path)) {
|
||||
foreach my $driver (readdir($dHandle)) {
|
||||
next if (($driver eq '.') || ($driver eq '..'));
|
||||
|
||||
if (-d make_path(SCST_TARGETS_DIR(), $driver)) {
|
||||
push @_drivers, $driver;
|
||||
}
|
||||
if (-d make_path(SCST_TARGETS_DIR(), $driver)) {
|
||||
push @drivers, $driver;
|
||||
}
|
||||
close $dHandle;
|
||||
} else {
|
||||
return (undef, "drivers(): Unable to read directory '$_path': $!");
|
||||
}
|
||||
close $dHandle;
|
||||
} else {
|
||||
return (undef, "drivers(): Unable to read directory '$_path': $!");
|
||||
}
|
||||
|
||||
return (\@_drivers, undef);
|
||||
return (\@drivers, undef);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user