Commit 9929e7d8 authored by Jason A. Donenfeld's avatar Jason A. Donenfeld Committed by John Wu

Remove update file on boot

It's not important to check the return value of unlink(2) or even verify
that the file exists. If this code is running, it means the system has
rebooted, and thus the update file, if any, should be removed so that
MagiskManager doesn't keep displaying the same message. We also handle
this before we handle "disable" so that disabled modules don't keep
requesting a reboot to update.
parent f6ee2525
...@@ -432,6 +432,8 @@ static int prepare_img() { ...@@ -432,6 +432,8 @@ static int prepare_img() {
rm_rf(buf); rm_rf(buf);
continue; continue;
} }
snprintf(buf, PATH_MAX, "%s/%s/update", MOUNTPOINT, entry->d_name);
unlink(buf);
snprintf(buf, PATH_MAX, "%s/%s/disable", MOUNTPOINT, entry->d_name); snprintf(buf, PATH_MAX, "%s/%s/disable", MOUNTPOINT, entry->d_name);
if (access(buf, F_OK) == 0) if (access(buf, F_OK) == 0)
continue; continue;
......
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