mirror of
https://git.proxmox.com/git/proxmox
synced 2025-05-03 16:45:23 +00:00
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 <dietmar@proxmox.com>
This commit is contained in:
parent
b87aa76b64
commit
e9bea7b7ed
@ -30,7 +30,7 @@ tokio-openssl = "0.6.1"
|
|||||||
tower-service = "0.3.0"
|
tower-service = "0.3.0"
|
||||||
url = "2.1"
|
url = "2.1"
|
||||||
|
|
||||||
proxmox = "0.14.0"
|
proxmox = "0.15.0"
|
||||||
proxmox-io = "1"
|
proxmox-io = "1"
|
||||||
proxmox-lang = "1"
|
proxmox-lang = "1"
|
||||||
proxmox-router = "1.1"
|
proxmox-router = "1.1"
|
||||||
|
@ -95,7 +95,7 @@ impl FileLogger {
|
|||||||
flags |= OFlag::O_EXCL;
|
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)
|
Ok(file)
|
||||||
}
|
}
|
||||||
|
@ -117,7 +117,7 @@ pub(crate) fn pstart() -> u64 {
|
|||||||
/// Helper to write the PID into a file
|
/// Helper to write the PID into a file
|
||||||
pub fn write_pid(pid_fn: &str) -> Result<(), Error> {
|
pub fn write_pid(pid_fn: &str) -> Result<(), Error> {
|
||||||
let pid_str = format!("{}\n", *PID);
|
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
|
/// Helper to read the PID from a file
|
||||||
|
@ -146,6 +146,7 @@ impl WorkerTaskSetup {
|
|||||||
&self.active_tasks_fn,
|
&self.active_tasks_fn,
|
||||||
active_raw.as_bytes(),
|
active_raw.as_bytes(),
|
||||||
options,
|
options,
|
||||||
|
false,
|
||||||
)?;
|
)?;
|
||||||
|
|
||||||
finish_list.sort_unstable_by(|a, b| {
|
finish_list.sort_unstable_by(|a, b| {
|
||||||
@ -166,6 +167,7 @@ impl WorkerTaskSetup {
|
|||||||
OFlag::O_APPEND | OFlag::O_RDWR,
|
OFlag::O_APPEND | OFlag::O_RDWR,
|
||||||
&[],
|
&[],
|
||||||
options,
|
options,
|
||||||
|
false,
|
||||||
)?;
|
)?;
|
||||||
for info in &finish_list {
|
for info in &finish_list {
|
||||||
writer.write_all(render_task_line(&info).as_bytes())?;
|
writer.write_all(render_task_line(&info).as_bytes())?;
|
||||||
|
Loading…
Reference in New Issue
Block a user