When counting blocks, ignore cryfs.config. This already worked on Linux, but not on Mac. After this commit, it is also fixed for Mac.

This commit is contained in:
Sebastian Messmer 2016-05-03 22:21:06 -07:00
parent 010833e25b
commit 285dd05072

View File

@ -78,7 +78,9 @@ void OnDiskBlockStore::remove(unique_ref<Block> block) {
uint64_t OnDiskBlockStore::numBlocks() const {
uint64_t count = 0;
for (auto entry = bf::directory_iterator(_rootdir); entry != bf::directory_iterator(); ++entry) {
count += std::distance(bf::directory_iterator(entry->path()), bf::directory_iterator());
if (bf::is_directory(entry->path())) {
count += std::distance(bf::directory_iterator(entry->path()), bf::directory_iterator());
}
}
return count;
}