diff options
author | PradeepKiruvale <PRADEEPKIRUVALE@gmail.com> | 2021-11-25 17:48:16 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-25 17:48:16 +0530 |
commit | 2dfb8f3ef3135cdb6cc6099e7af03a41d72b83d7 (patch) | |
tree | 08bc6eda81bc9db57509c96be6d06434b6f0654b /crates/common | |
parent | 60dae5fabdbd90eb1f1dc304a49b9ffeb1d99acc (diff) |
fix the armv7-32bit musl build issue (#630)
Co-authored-by: Pradeep Kumar K J <pradeepkumar.kj@sofwareag.com>
Diffstat (limited to 'crates/common')
-rw-r--r-- | crates/common/download/src/download.rs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/crates/common/download/src/download.rs b/crates/common/download/src/download.rs index 3f88e72e..38eae6dd 100644 --- a/crates/common/download/src/download.rs +++ b/crates/common/download/src/download.rs @@ -119,11 +119,13 @@ fn create_file_and_try_pre_allocate_space( if let Some(root) = file_path.parent() { let tmpstats = statvfs::statvfs(root)?; // Reserve 5% of total disk space - let five_percent_disk_space = (tmpstats.blocks() * tmpstats.block_size()) * 5 / 100; - let usable_disk_space = - tmpstats.blocks_free() * tmpstats.block_size() - five_percent_disk_space; + let five_percent_disk_space = + (tmpstats.blocks() as usize * tmpstats.block_size() as usize) * 5 / 100; + let usable_disk_space = tmpstats.blocks_free() as usize + * tmpstats.block_size() as usize + - five_percent_disk_space; - if file_len >= usable_disk_space as usize { + if file_len >= usable_disk_space { return Err(DownloadError::InsufficientSpace); } // Reserve diskspace |