[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-2-0' - common/FileUtil.cpp
Jan Holesovsky
kendy at collabora.com
Fri Feb 24 14:25:50 UTC 2017
common/FileUtil.cpp | 7 +++++++
1 file changed, 7 insertions(+)
New commits:
commit df2cbdb017d7ed965a8010b009d55d89ffdccbc4
Author: Jan Holesovsky <kendy at collabora.com>
Date: Tue Feb 21 19:55:04 2017 +0100
We should be able to run with 5G of free space just fine.
Change-Id: Ie5df96388eeaa0ddf1a41564ec7d52c283e6b1bb
diff --git a/common/FileUtil.cpp b/common/FileUtil.cpp
index ea55548..72afa65 100644
--- a/common/FileUtil.cpp
+++ b/common/FileUtil.cpp
@@ -195,8 +195,15 @@ namespace FileUtil
if (statfs(path.c_str(), &sfs) == -1)
return true;
+ // we should be able to run just OK with 5GB
+ constexpr int64_t ENOUGH_SPACE = int64_t(5)*1024*1024*1024;
+
+ if (static_cast<int64_t>(sfs.f_bavail) * sfs.f_bsize > ENOUGH_SPACE)
+ return true;
+
if (static_cast<double>(sfs.f_bavail) / sfs.f_blocks <= 0.05)
return false;
+
return true;
}
More information about the Libreoffice-commits
mailing list