From: Arvin Schnell Date: Mon, 29 Oct 2018 11:51:16 +0000 (+0100) Subject: - added checks X-Git-Tag: v0.8.0~7^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F447%2Fhead;p=thirdparty%2Fsnapper.git - added checks --- diff --git a/client/cleanup.cc b/client/cleanup.cc index 07f27d8f..e1d5f5b5 100644 --- a/client/cleanup.cc +++ b/client/cleanup.cc @@ -253,6 +253,9 @@ Cleaner::is_quota_satisfied() const { QuotaData quota_data = snapper->queryQuotaData(); + if (quota_data.size == 0) + return true; + double fraction = (double)(quota_data.used) / (double)(quota_data.size); bool satisfied = fraction < parameters.space_limit; @@ -294,6 +297,9 @@ Cleaner::is_free_satisfied() const { FreeSpaceData free_space_data = snapper->queryFreeSpaceData(); + if (free_space_data.size == 0) + return true; + double fraction = (double)(free_space_data.free) / (double)(free_space_data.size); bool satisfied = fraction > parameters.free_limit;