common/FileUtil.cpp | 7 +++++++ 1 file changed, 7 insertions(+) New commits: commit 7eff2294d938d0e14db50a385ab9e226c14f7c77 Author: Jan Holesovsky <ke...@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 078379b..52dd3ec 100644 --- a/common/FileUtil.cpp +++ b/common/FileUtil.cpp @@ -236,8 +236,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; } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits