fix: fix wrong used size calculation

This commit is contained in:
utox39
2025-07-27 14:42:52 +02:00
parent e88586c47a
commit 67a2e19ac4
2 changed files with 2 additions and 2 deletions

View File

@@ -291,7 +291,7 @@ pub fn getDiskSize(disk_path: []const u8) !DiskInfo {
}
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_percentage = (used_size * 100) / total_size;

View File

@@ -418,7 +418,7 @@ pub fn getDiskSize(disk_path: []const u8) !DiskInfo {
}
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_percentage = (used_size * 100) / total_size;