1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 05:27:46 +00:00

du: Replace home-grown block-based size calculation with ceil_div

This commit is contained in:
Tim Schumacher 2022-07-20 22:46:59 +02:00 committed by Andreas Kling
parent bb5db7fba6
commit c938321731

View file

@ -162,7 +162,7 @@ ErrorOr<off_t> print_space_usage(String const& path, DuOption const& du_option,
out("{}", human_readable_size(size));
} else {
constexpr long long block_size = 1024;
size = size / block_size + (size % block_size != 0);
size = ceil_div(size, block_size);
out("{}", size);
}