From 1d7a63fb8fbdc2fb53744ee1be13b76278fda03d Mon Sep 17 00:00:00 2001 From: bruvzg <7645683+bruvzg@users.noreply.github.com> Date: Mon, 31 May 2021 12:57:18 +0300 Subject: [PATCH] Fix `Directory::get_space_left()` result on macOS and Linux. --- drivers/unix/dir_access_unix.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/unix/dir_access_unix.cpp b/drivers/unix/dir_access_unix.cpp index 5abe5d2c87c..a2c9bae8529 100644 --- a/drivers/unix/dir_access_unix.cpp +++ b/drivers/unix/dir_access_unix.cpp @@ -460,7 +460,7 @@ uint64_t DirAccessUnix::get_space_left() { return 0; }; - return vfs.f_bfree * vfs.f_bsize; + return (uint64_t)vfs.f_bavail * (uint64_t)vfs.f_frsize; #else // FIXME: Implement this. return 0;