From 0298c2ecc34a0bbb10b8a209fef379a823fd9668 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Thu, 10 Oct 2013 15:36:40 +0000 Subject: [PATCH] scstadmin, SCST.pm: Fix checkTargetDynamicAttributes() return code If no attributes have been passed to this function via the second argument, only report success if the driver (first argument) exists. git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5067 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scstadmin/scstadmin.sysfs/scst-0.9.10/lib/SCST/SCST.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scstadmin/scstadmin.sysfs/scst-0.9.10/lib/SCST/SCST.pm b/scstadmin/scstadmin.sysfs/scst-0.9.10/lib/SCST/SCST.pm index af0fe5226..b259e0e3b 100644 --- a/scstadmin/scstadmin.sysfs/scst-0.9.10/lib/SCST/SCST.pm +++ b/scstadmin/scstadmin.sysfs/scst-0.9.10/lib/SCST/SCST.pm @@ -1310,8 +1310,6 @@ sub checkTargetDynamicAttributes { my $driver = shift; my $check = shift; - return FALSE if (!defined($check)); - my $rc = $self->driverExists($driver); return SCST_C_DRV_NO_DRIVER if (!$rc); return $rc if (!$rc > 1); @@ -1320,6 +1318,8 @@ sub checkTargetDynamicAttributes { return SCST_C_FATAL_ERROR if (!defined($available)); + return FALSE if (!defined($check)); + if (ref($check) eq 'HASH') { foreach my $attribute (keys %{$check}) { if (!defined($$available{$attribute})) {