Skip to content

Commit

Permalink
updatehub: ensure all disk space calculations uses u64
Browse files Browse the repository at this point in the history
Signed-off-by: Otavio Salvador <[email protected]>
  • Loading branch information
otavio committed Mar 8, 2024
1 parent 8ddb6da commit 343e22c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion updatehub/src/utils/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ pub(crate) fn ensure_disk_space(target: &Path, required: u64) -> Result<()> {
let stat = nix::sys::statvfs::statvfs(target)?;

// stat fields might be 32 or 64 bytes depending on host arch
let available = stat.block_size() * stat.blocks_free();
let available: u64 = stat.block_size() * stat.blocks_free();

if required > available {
return Err(Error::NotEnoughSpace { available, required });
Expand Down

0 comments on commit 343e22c

Please sign in to comment.