From 0dcbc10b5e79701e65d63a4bd184ba4f81b1db62 Mon Sep 17 00:00:00 2001 From: Patrick LeBlanc Date: Tue, 21 May 2019 16:05:27 -0500 Subject: [PATCH] Added assertions around the file deletes in syncwithjournal. --- src/Synchronizer.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/Synchronizer.cpp b/src/Synchronizer.cpp index 6ebeead4b..cbe402956 100644 --- a/src/Synchronizer.cpp +++ b/src/Synchronizer.cpp @@ -491,7 +491,11 @@ void Synchronizer::synchronizeWithJournal(const string &sourceFile, list count += err; } cache->rename(key, newKey, size - bf::file_size(oldCachePath)); - replicator->remove(oldCachePath.string().c_str()); + #ifndef NDEBUG + assert(replicator->remove(oldCachePath) == 0); + #else + replicator->remove(oldCachePath); + #endif } // update the metadata for the source file @@ -504,7 +508,11 @@ void Synchronizer::synchronizeWithJournal(const string &sourceFile, list // delete the old object & journal file cache->deletedJournal(bf::file_size(journalName)); - replicator->remove(journalName.c_str()); + #ifndef NDEBUG + assert(replicator->remove(journalName) == 0); + #else + replicator->remove(journalName); + #endif cs->deleteObject(key); }