- Die if /proc/scsi_tgt/version doesn't exist.

- Replace croak() with die() in the module.



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1411 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Mark Buechler
2009-12-23 19:55:07 +00:00
parent c79bc30298
commit 14fe1bed1e
2 changed files with 7 additions and 2 deletions

View File

@@ -2,6 +2,8 @@ Changes for 1.0.11
- Added -noprompt option. Use with care!
- Added support for T10 device ID.
- Die if /proc/scsi_tgt/version doesn't exist.
- Replace croak() with die() in the module.
Changes for 1.0.10

View File

@@ -128,6 +128,9 @@ sub new {
my $scstVersion = $self->scstVersion();
die("Failed to obtain SCST version information. Is the scst module loaded?\n")
if ($scstVersion == -1);
my($major, $minor, $release) = split(/\./, $scstVersion, 3);
($release, undef) = split(/\-/, $release) if ($release =~ /\-/);
@@ -136,7 +139,7 @@ sub new {
(($major == $_SCST_MIN_MAJOR_) && ($minor == $_SCST_MIN_MINOR_) &&
($release >= $_SCST_MIN_RELEASE_)));
croak("This module requires at least SCST version $_SCST_MIN_MAJOR_\.$_SCST_MIN_MINOR_\.".
die("This module requires at least SCST version $_SCST_MIN_MAJOR_\.$_SCST_MIN_MINOR_\.".
"$_SCST_MIN_RELEASE_ and version $scstVersion was found") if ($badVersion);
return $self;
@@ -146,7 +149,7 @@ sub scstVersion {
my $self = shift;
my $io = new IO::File $_SCST_VERSION_IO_, O_RDONLY;
return 1 if (!$io);
return -1 if (!$io);
my $version = <$io>;
chomp $version;