]> git.ipfire.org Git - thirdparty/snapper.git/commitdiff
- added checks 447/head
authorArvin Schnell <aschnell@suse.de>
Mon, 29 Oct 2018 11:51:16 +0000 (12:51 +0100)
committerArvin Schnell <aschnell@suse.de>
Mon, 29 Oct 2018 11:51:16 +0000 (12:51 +0100)
client/cleanup.cc

index 07f27d8f53c07808a10b3d689652c38fdc4032ca..e1d5f5b5795a30b67522ecb19d0d3f2343ca11e8 100644 (file)
@@ -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;