summaryrefslogtreecommitdiffstats
path: root/crates/common
diff options
context:
space:
mode:
authorAlbin Suresh <albin.suresh@softwareag.com>2022-02-04 21:32:32 +0530
committerGitHub <noreply@github.com>2022-02-04 21:32:32 +0530
commitc15cfc4bee97473411ed173903f808c1132b8d8c (patch)
treeeb9c1337c25b81764ede6ad1834705c62ae72959 /crates/common
parent43bf45a3bd868586afe83a645be67f5042d9ac5d (diff)
[#735] Detect and reconcile alarms updated while mapper was down (#791)
* [#735] Detect and reconcile cleared alarms while mapper was down on its restart * Rust integration test for C8Y mapper * Rust integration test for alarm syncing on startup * New publish apis in mqtt_test crate that supports retain flag and QoS * Refactor alarm conversion logic to dedicated AlarmConverter enum
Diffstat (limited to 'crates/common')
-rw-r--r--crates/common/download/src/download.rs9
1 files changed, 5 insertions, 4 deletions
diff --git a/crates/common/download/src/download.rs b/crates/common/download/src/download.rs
index 92d7c168..472e11e0 100644
--- a/crates/common/download/src/download.rs
+++ b/crates/common/download/src/download.rs
@@ -1,9 +1,8 @@
use crate::error::DownloadError;
use backoff::{future::retry, ExponentialBackoff};
-use nix::{
- fcntl::{fallocate, FallocateFlags},
- sys::statvfs,
-};
+#[cfg(target_os = "linux")]
+use nix::fcntl::{fallocate, FallocateFlags};
+use nix::sys::statvfs;
use serde::{Deserialize, Serialize};
use std::{
fs::File,
@@ -177,6 +176,7 @@ fn create_file_and_try_pre_allocate_space(
return Err(DownloadError::InsufficientSpace);
}
// Reserve diskspace
+ #[cfg(target_os = "linux")]
let _ = fallocate(
file.as_raw_fd(),
FallocateFlags::empty(),
@@ -239,6 +239,7 @@ mod tests {
Ok(())
}
+ #[cfg(target_os = "linux")]
#[tokio::test]
async fn downloader_download_with_content_length_larger_than_usable_disk_space(
) -> anyhow::Result<()> {