diff options
author | Chris Wilson <chris+github@qwirx.com> | 2013-09-19 23:03:23 +0000 |
---|---|---|
committer | Chris Wilson <chris+github@qwirx.com> | 2013-09-19 23:03:23 +0000 |
commit | 0493911c98154599b15c63514d0007f38e983748 (patch) | |
tree | 73f9c708a8532d9b316eaf5f280cab400b9fd9d7 /lib/backupstore/BackupStoreCheckData.cpp | |
parent | 2034a26f414cf4a4538c51c9e49214c58508b8d1 (diff) |
Repeatedly "fix" directories until all errors are cleared.
Fixes some cases where a directory might refer to an object that doesn't
exist, which is removed from the directory, but an object that depends on
it (a patch) isn't removed, and requires a subsequent recheck.
Diffstat (limited to 'lib/backupstore/BackupStoreCheckData.cpp')
-rw-r--r-- | lib/backupstore/BackupStoreCheckData.cpp | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/lib/backupstore/BackupStoreCheckData.cpp b/lib/backupstore/BackupStoreCheckData.cpp index fed0c3f1..ec606d52 100644 --- a/lib/backupstore/BackupStoreCheckData.cpp +++ b/lib/backupstore/BackupStoreCheckData.cpp @@ -65,16 +65,11 @@ void BackupStoreCheck::AddID(BackupStoreCheck_ID_t ID, if(mpInfoLastBlock == 0 || mInfoLastBlockEntries >= BACKUPSTORECHECK_BLOCK_SIZE) { // No. Allocate a new one - IDBlock *pblk = (IDBlock*)::malloc(sizeof(IDBlock)); + IDBlock *pblk = (IDBlock*)calloc(1, sizeof(IDBlock)); if(pblk == 0) { throw std::bad_alloc(); } - // Zero all the flags entries - for(int z = 0; z < (BACKUPSTORECHECK_BLOCK_SIZE * Flags__NumFlags / Flags__NumItemsPerEntry); ++z) - { - pblk->mFlags[z] = 0; - } // Store in map mInfo[ID] = pblk; // Allocated and stored OK, setup for use @@ -141,8 +136,8 @@ BackupStoreCheck::IDBlock *BackupStoreCheck::LookupID(BackupStoreCheck_ID_t ID, pblock = ib->second; } - ASSERT(pblock != 0); if(pblock == 0) return 0; + ASSERT(pblock != 0); // How many entries are there in the block int32_t bentries = (pblock == mpInfoLastBlock)?mInfoLastBlockEntries:BACKUPSTORECHECK_BLOCK_SIZE; |