X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=perl%2FAmanda%2FChanger%2Fndmp.pm;h=dab9a7f80e71a199972bee84156e03fa25513c85;hb=d28952249e392eb31bc8eecc53f6c477f30c617b;hp=016db8f8af08f8f4ee46819e7457480aca00d8b3;hpb=b116e9366c7b2ea2c2eb53b0a13df4090e176235;p=debian%2Famanda diff --git a/perl/Amanda/Changer/ndmp.pm b/perl/Amanda/Changer/ndmp.pm index 016db8f..dab9a7f 100644 --- a/perl/Amanda/Changer/ndmp.pm +++ b/perl/Amanda/Changer/ndmp.pm @@ -1,8 +1,9 @@ -# Copyright (c) 2009,2010 Zmanda, Inc. All Rights Reserved. +# Copyright (c) 2009-2012 Zmanda, Inc. All Rights Reserved. # -# This library is free software; you can redistribute it and/or modify it -# under the terms of the GNU Lesser General Public License version 2.1 as -# published by the Free Software Foundation. +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +#* License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY @@ -110,6 +111,7 @@ sub get_device { package Amanda::Changer::ndmp::Interface; +use Carp; use Amanda::NDMP qw( :constants ); use Amanda::Debug qw( debug warning ); use Amanda::MainLoop; @@ -422,9 +424,9 @@ sub _parse_read_element_status { my $all_descrips_len = ($all_descrips_len_msb << 16) + $all_descrips_len_lsw; my $have_pvoltag = $flags & 0x80; my $have_avoltag = $flags & 0x40; - die unless $all_descrips_len % $descrip_len == 0; - die unless $all_descrips_len >= $descrip_len; - die length($data) unless $all_descrips_len <= length($data); + confess unless $all_descrips_len % $descrip_len == 0; + confess unless $all_descrips_len >= $descrip_len; + confess (length($data)) unless $all_descrips_len <= length($data); $data = substr($data, 8); while ($all_descrips_len > 0) { # for each element status descriptor