From 83eb05273f71756f317270ebac7a7a9e59c3a4b8 Mon Sep 17 00:00:00 2001 From: bunnie Date: Mon, 18 Jul 2022 03:09:07 +0800 Subject: [PATCH] sync the PDDB before doing a backup --- services/status/src/main.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/services/status/src/main.rs b/services/status/src/main.rs index 6af886e15..ff0a37605 100644 --- a/services/status/src/main.rs +++ b/services/status/src/main.rs @@ -998,6 +998,9 @@ fn wrapped_main() -> ! { com.set_backlight(0, 0).expect("cannot set backlight off"); }, Some(StatusOpcode::PrepareBackup) => { + // sync the PDDB to disk prior to making backups + let pddb = pddb::Pddb::new(); + pddb.sync().expect("couldn't synchronize PDDB to disk"); let mut metadata = root_keys::api::BackupHeader::default(); // note: default() should set the language correctly by default since it's a systemwide constant metadata.timestamp = localtime.get_local_time_ms().unwrap_or(0);