summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPradeepKiruvale <PRADEEPKIRUVALE@gmail.com>2021-11-19 15:29:46 +0530
committerGitHub <noreply@github.com>2021-11-19 10:59:46 +0100
commita1418f015a68d0e9a04e99c02b9dd375f7f243be (patch)
treef9335363c66773d7f239ff7b7a1d4ffb7f5da482
parentc21c24a2530747aa35328c9dbca0fc87526eb0cc (diff)
Fix build issue on 32bit system (#585)
* fix build on 32bit system Co-authored-by: Pradeep Kumar K J <pradeepkumar.kj@sofwareag.com>
-rw-r--r--Cargo.lock4
-rw-r--r--sm/download/src/download.rs8
2 files changed, 6 insertions, 6 deletions
diff --git a/Cargo.lock b/Cargo.lock
index c37b4d61..b365009c 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -1245,9 +1245,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
[[package]]
name = "libc"
-version = "0.2.103"
+version = "0.2.107"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dd8f7255a17a627354f321ef0055d63b898c6fb27eff628af4d1b66b7331edf6"
+checksum = "fbe5e23404da5b4f555ef85ebed98fb4083e55a00c317800bc2a50ede9f3d219"
[[package]]
name = "lock_api"
diff --git a/sm/download/src/download.rs b/sm/download/src/download.rs
index 7ee6e472..3f88e72e 100644
--- a/sm/download/src/download.rs
+++ b/sm/download/src/download.rs
@@ -81,7 +81,7 @@ impl Downloader {
.await?;
let file_len = match response.content_length() {
- Some(len) => len as u64,
+ Some(len) => len as usize,
None => 0,
};
let mut file =
@@ -112,7 +112,7 @@ impl Downloader {
fn create_file_and_try_pre_allocate_space(
file_path: &Path,
- file_len: u64,
+ file_len: usize,
) -> Result<File, DownloadError> {
let file = File::create(file_path)?;
if file_len > 0 {
@@ -123,7 +123,7 @@ fn create_file_and_try_pre_allocate_space(
let usable_disk_space =
tmpstats.blocks_free() * tmpstats.block_size() - five_percent_disk_space;
- if file_len >= usable_disk_space {
+ if file_len >= usable_disk_space as usize {
return Err(DownloadError::InsufficientSpace);
}
// Reserve diskspace
@@ -131,7 +131,7 @@ fn create_file_and_try_pre_allocate_space(
file.as_raw_fd(),
FallocateFlags::empty(),
0,
- file_len as i64,
+ file_len as nix::libc::off_t,
);
}
}