mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-14 09:11:27 +00:00
scstadmin: Fix the readOnly() subroutine
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9157 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
@@ -359,7 +359,11 @@ sub readOnly {
|
||||
my ($path) = @_;
|
||||
my $mode = (stat($path))[2];
|
||||
|
||||
return ($mode & S_IWUSR) != 0;
|
||||
if (!defined($mode)) {
|
||||
cluck("invalid path $path");
|
||||
return undef;
|
||||
}
|
||||
return ($mode & S_IWUSR) == 0;
|
||||
}
|
||||
|
||||
sub scstVersion {
|
||||
|
||||
@@ -30,7 +30,7 @@ ok($SCST->setScstAttribute('no-such-attribute', '1'),
|
||||
$SCST->SCST_C_BAD_ATTRIBUTES);
|
||||
|
||||
ok($SCST->setScstAttribute('last_sysfs_mgmt_res', '1'),
|
||||
$SCST->SCST_C_SETATTR_FAIL);
|
||||
$SCST->SCST_C_ATTRIBUTE_STATIC);
|
||||
|
||||
my $threads = getScstThreadCount($SCST);
|
||||
ok(ref(\$threads), "SCALAR");
|
||||
|
||||
Reference in New Issue
Block a user