circache: fix some wrong return -1 in bool funcs

This commit is contained in:
Jean-Francois Dockes 2021-03-29 16:57:04 +01:00
parent 7a54c3a110
commit c271ff7b88

View File

@ -803,7 +803,7 @@ bool CirCache::uniquentries()
{ {
if (m_d == 0) { if (m_d == 0) {
LOGERR("CirCache::open: null data\n"); LOGERR("CirCache::open: null data\n");
return -1; return false;
} }
return m_d->m_uniquentries; return m_d->m_uniquentries;
} }
@ -1427,7 +1427,7 @@ bool CirCache::compact(const std::string& dir, std::string *reason)
if (reason) { if (reason) {
*reason = msg.str(); *reason = msg.str();
} }
return -1; return false;
} }
long long avmbs; long long avmbs;
if (fsocc(dir, nullptr, &avmbs) && avmbs * 1024 * 1024 < 1.2 * occ->size()) { if (fsocc(dir, nullptr, &avmbs) && avmbs * 1024 * 1024 < 1.2 * occ->size()) {
@ -1546,7 +1546,7 @@ bool CirCache::burst(const std::string& ccdir, const std::string destdir, std::s
if (reason) { if (reason) {
*reason = msg.str(); *reason = msg.str();
} }
return -1; return false;
} }
long long avmbs; long long avmbs;
if (fsocc(destdir, nullptr, &avmbs) && avmbs * 1024 * 1024 < 1.2 * occ->size()) { if (fsocc(destdir, nullptr, &avmbs) && avmbs * 1024 * 1024 < 1.2 * occ->size()) {