summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/backupstore/BackupStoreDirectory.cpp18
-rw-r--r--lib/backupstore/BackupStoreDirectory.h5
2 files changed, 18 insertions, 5 deletions
diff --git a/lib/backupstore/BackupStoreDirectory.cpp b/lib/backupstore/BackupStoreDirectory.cpp
index 0d06da34..81126ede 100644
--- a/lib/backupstore/BackupStoreDirectory.cpp
+++ b/lib/backupstore/BackupStoreDirectory.cpp
@@ -115,7 +115,8 @@ BackupStoreDirectory::~BackupStoreDirectory()
//
// Function
// Name: BackupStoreDirectory::ReadFromStream(IOStream &, int)
-// Purpose: Reads the directory contents from a stream. Exceptions will yeild incomplete reads.
+// Purpose: Reads the directory contents from a stream.
+// Exceptions will result in incomplete reads.
// Created: 2003/08/26
//
// --------------------------------------------------------------------------
@@ -131,7 +132,12 @@ void BackupStoreDirectory::ReadFromStream(IOStream &rStream, int Timeout)
// Check magic value...
if(OBJECTMAGIC_DIR_MAGIC_VALUE != ntohl(hdr.mMagicValue))
{
- THROW_EXCEPTION(BackupStoreException, BadDirectoryFormat)
+ THROW_EXCEPTION_MESSAGE(BackupStoreException, BadDirectoryFormat,
+ "Wrong magic number in directory object " <<
+ BOX_FORMAT_OBJECTID(mObjectID) << ": expected " <<
+ BOX_FORMAT_HEX32(OBJECTMAGIC_DIR_MAGIC_VALUE) <<
+ " but found " <<
+ BOX_FORMAT_HEX32(ntohl(hdr.mMagicValue)));
}
// Get data
@@ -307,9 +313,13 @@ BackupStoreDirectory::Entry *BackupStoreDirectory::AddEntry(const Entry &rEntryT
// Created: 2003/08/27
//
// --------------------------------------------------------------------------
-BackupStoreDirectory::Entry *BackupStoreDirectory::AddEntry(const BackupStoreFilename &rName, box_time_t ModificationTime, int64_t ObjectID, int64_t SizeInBlocks, int16_t Flags, box_time_t AttributesModTime)
+BackupStoreDirectory::Entry *
+BackupStoreDirectory::AddEntry(const BackupStoreFilename &rName,
+ box_time_t ModificationTime, int64_t ObjectID, int64_t SizeInBlocks,
+ int16_t Flags, uint64_t AttributesHash)
{
- Entry *pnew = new Entry(rName, ModificationTime, ObjectID, SizeInBlocks, Flags, AttributesModTime);
+ Entry *pnew = new Entry(rName, ModificationTime, ObjectID,
+ SizeInBlocks, Flags, AttributesHash);
try
{
mEntries.push_back(pnew);
diff --git a/lib/backupstore/BackupStoreDirectory.h b/lib/backupstore/BackupStoreDirectory.h
index c8d3a11f..616addc9 100644
--- a/lib/backupstore/BackupStoreDirectory.h
+++ b/lib/backupstore/BackupStoreDirectory.h
@@ -149,7 +149,10 @@ public:
bool StreamAttributes = true, bool StreamDependencyInfo = true) const;
Entry *AddEntry(const Entry &rEntryToCopy);
- Entry *AddEntry(const BackupStoreFilename &rName, box_time_t ModificationTime, int64_t ObjectID, int64_t SizeInBlocks, int16_t Flags, box_time_t AttributesModTime);
+ Entry *AddEntry(const BackupStoreFilename &rName,
+ box_time_t ModificationTime, int64_t ObjectID,
+ int64_t SizeInBlocks, int16_t Flags,
+ uint64_t AttributesHash);
void DeleteEntry(int64_t ObjectID);
Entry *FindEntryByID(int64_t ObjectID) const;