Commit 7bf9c742 authored by topjohnwu's avatar topjohnwu

Don't skip backup even if original does not exist

Close #5945, fix #5944
parent e2f37535
......@@ -142,15 +142,13 @@ void magisk_cpio::restore() {
}
void magisk_cpio::backup(const char *orig) {
if (access(orig, R_OK))
return;
entry_map backups;
string rm_list;
backups.emplace(".backup", new cpio_entry(S_IFDIR));
magisk_cpio o;
o.load_cpio(orig);
if (access(orig, R_OK) == 0)
o.load_cpio(orig);
// Remove existing backups in original ramdisk
o.rm(".backup", true);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment