Skip to content
Snippets Groups Projects
Commit 525ececd authored by Victor Kotlyar's avatar Victor Kotlyar
Browse files

Ported commit 2cf7ef6144c96cfdb5aba6424afc0be0da976235 from castor/master

With respect to crc32c, modified error logs so that they are different
in different contexts
parent b55db931
No related branches found
No related tags found
No related merge requests found
......@@ -717,7 +717,7 @@ void drive::DriveGeneric::writeBlock(const void * data, size_t count) {
countWithCrc32c)) {
delete[] dataWithCrc32c;
cta::exception::Errnum::throwOnMinusOne(-1,
"Failed ST write in DriveGeneric::writeBlock");
"Failed ST write with crc32c in DriveGeneric::writeBlock");
}
delete[] dataWithCrc32c;
break;
......@@ -754,7 +754,7 @@ ssize_t drive::DriveGeneric::readBlock(void * data, size_t count) {
if(NULL == dataWithCrc32c) {
throw cta::exception::MemException("In DriveGeneric::readBlock: Failed to allocate memory");
}
ssize_t res = m_sysWrapper.read(m_tapeFD, dataWithCrc32c,
const ssize_t res = m_sysWrapper.read(m_tapeFD, dataWithCrc32c,
count+SCSI::logicBlockProtectionMethod::CRC32CLength);
if ( -1 == res ) {
delete[] dataWithCrc32c;
......@@ -815,7 +815,7 @@ void drive::DriveGeneric::readExactBlock(void * data, size_t count, std::string
throw cta::exception::MemException("Failed to allocate memory "
" for a new MemBlock in DriveGeneric::readBlock!");
}
ssize_t res = m_sysWrapper.read(m_tapeFD, dataWithCrc32c,
const ssize_t res = m_sysWrapper.read(m_tapeFD, dataWithCrc32c,
count+SCSI::logicBlockProtectionMethod::CRC32CLength);
// First handle block too big
......@@ -827,7 +827,7 @@ void drive::DriveGeneric::readExactBlock(void * data, size_t count, std::string
if (-1 == res) {
delete[] dataWithCrc32c;
cta::exception::Errnum::throwOnMinusOne(res,
context+": Failed ST read in DriveGeneric::readExactBlock");
context+": Failed ST read with crc32c in DriveGeneric::readExactBlock");
}
// Handle mismatch
if ((size_t) (res - SCSI::logicBlockProtectionMethod::CRC32CLength)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment