From e9bea7b7ede49bc547265cad1c7b3dedcbb33303 Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Wed, 20 Oct 2021 14:56:15 +0200 Subject: [PATCH] use new fsync parameter to replace_file and atomic_open_or_create Depend on proxmox 0.15.0 and proxmox-openid 0.8.1 Signed-off-by: Dietmar Maurer --- proxmox-rest-server/Cargo.toml | 2 +- proxmox-rest-server/src/file_logger.rs | 2 +- proxmox-rest-server/src/lib.rs | 2 +- proxmox-rest-server/src/worker_task.rs | 2 ++ 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/proxmox-rest-server/Cargo.toml b/proxmox-rest-server/Cargo.toml index 9eb3860f..1fa76f21 100644 --- a/proxmox-rest-server/Cargo.toml +++ b/proxmox-rest-server/Cargo.toml @@ -30,7 +30,7 @@ tokio-openssl = "0.6.1" tower-service = "0.3.0" url = "2.1" -proxmox = "0.14.0" +proxmox = "0.15.0" proxmox-io = "1" proxmox-lang = "1" proxmox-router = "1.1" diff --git a/proxmox-rest-server/src/file_logger.rs b/proxmox-rest-server/src/file_logger.rs index 79972d32..c7496874 100644 --- a/proxmox-rest-server/src/file_logger.rs +++ b/proxmox-rest-server/src/file_logger.rs @@ -95,7 +95,7 @@ impl FileLogger { flags |= OFlag::O_EXCL; } - let file = atomic_open_or_create_file(&file_name, flags, &[], options.file_opts.clone())?; + let file = atomic_open_or_create_file(&file_name, flags, &[], options.file_opts.clone(), false)?; Ok(file) } diff --git a/proxmox-rest-server/src/lib.rs b/proxmox-rest-server/src/lib.rs index 6e7c94f2..1a6d827d 100644 --- a/proxmox-rest-server/src/lib.rs +++ b/proxmox-rest-server/src/lib.rs @@ -117,7 +117,7 @@ pub(crate) fn pstart() -> u64 { /// Helper to write the PID into a file pub fn write_pid(pid_fn: &str) -> Result<(), Error> { let pid_str = format!("{}\n", *PID); - proxmox::tools::fs::replace_file(pid_fn, pid_str.as_bytes(), CreateOptions::new()) + proxmox::tools::fs::replace_file(pid_fn, pid_str.as_bytes(), CreateOptions::new(), false) } /// Helper to read the PID from a file diff --git a/proxmox-rest-server/src/worker_task.rs b/proxmox-rest-server/src/worker_task.rs index fb0dea9b..242d2de2 100644 --- a/proxmox-rest-server/src/worker_task.rs +++ b/proxmox-rest-server/src/worker_task.rs @@ -146,6 +146,7 @@ impl WorkerTaskSetup { &self.active_tasks_fn, active_raw.as_bytes(), options, + false, )?; finish_list.sort_unstable_by(|a, b| { @@ -166,6 +167,7 @@ impl WorkerTaskSetup { OFlag::O_APPEND | OFlag::O_RDWR, &[], options, + false, )?; for info in &finish_list { writer.write_all(render_task_line(&info).as_bytes())?;