From 9b7a525b2dfd55c8400418045ed9342c92ca21eb Mon Sep 17 00:00:00 2001 From: HimbeerserverDE Date: Fri, 5 May 2023 23:35:47 +0200 Subject: flush all changes to disk immediately --- src/main.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main.rs b/src/main.rs index 635acf8..8513288 100644 --- a/src/main.rs +++ b/src/main.rs @@ -250,6 +250,7 @@ fn modify_cmdline(old: &str, new: &str) -> Result<()> { replace_slice(&mut cmdline, old.as_bytes(), new.as_bytes()); fs::write(boot, cmdline)?; + nix::unistd::sync(); Ok(()) } @@ -333,6 +334,7 @@ async fn stream_to(dst: &str, data: &[u8]) -> Result<()> { file.write_all(data)?; file.sync_all()?; + nix::unistd::sync(); Ok(()) } -- cgit v1.2.3