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.
This commit is contained in:
Jason A. Donenfeld 2018-06-08 22:58:00 +02:00 committed by John Wu
parent f6ee252572
commit 9929e7d8e8

View File

@ -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;