From 7f554a96d54aebdcaf4fd9e68af17f099a015b9d Mon Sep 17 00:00:00 2001 From: HimbeerserverDE Date: Thu, 24 Aug 2023 11:52:42 +0200 Subject: sync to disk after letting the drop handlers of modify_cmdline flush the files --- src/main.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index 883ab49..76bd213 100644 --- a/src/main.rs +++ b/src/main.rs @@ -260,7 +260,6 @@ fn modify_cmdline(new: &str) -> Result<()> { file.write_all(new.as_bytes())?; - nix::unistd::sync(); Ok(()) } @@ -355,5 +354,7 @@ fn switch_to_inactive_root() -> Result<()> { let cmdline = format!("{} init=/bin/init rootwait console=tty1", new); modify_cmdline(&cmdline)?; + nix::unistd::sync(); + Ok(()) } -- cgit v1.2.3