Merge pull request #6 from utox39/fix/fix-wrong-used-size

fix: fix wrong used size calculation
This commit is contained in:
utox39 authored and GitHub committed 2025-07-27 14:52:37 +02:00
commit f1bebb08e9
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -320,7 +320,7 @@ pub fn getDiskSize(disk_path: []const u8) !DiskInfo {
} }
const total_size = stat.f_blocks * stat.f_frsize; const total_size = stat.f_blocks * stat.f_frsize;
const free_size = stat.f_bavail * stat.f_frsize; const free_size = stat.f_bfree * stat.f_frsize;
const used_size = total_size - free_size; const used_size = total_size - free_size;
const used_size_percentage = (used_size * 100) / total_size; const used_size_percentage = (used_size * 100) / total_size;
+1 -1
View File
@@ -418,7 +418,7 @@ pub fn getDiskSize(disk_path: []const u8) !DiskInfo {
} }
const total_size = stat.f_blocks * stat.f_frsize; const total_size = stat.f_blocks * stat.f_frsize;
const free_size = stat.f_bavail * stat.f_frsize; const free_size = stat.f_bfree * stat.f_frsize;
const used_size = total_size - free_size; const used_size = total_size - free_size;
const used_size_percentage = (used_size * 100) / total_size; const used_size_percentage = (used_size * 100) / total_size;