From f395cfb4902ea901f943e44bc7e818939ddaa106 Mon Sep 17 00:00:00 2001 From: Nullptr Date: Fri, 24 Feb 2023 16:43:53 +0800 Subject: [PATCH] Fix stupid remount bug --- loader/src/injector/unmount.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/loader/src/injector/unmount.cpp b/loader/src/injector/unmount.cpp index 77dc3dc..d2598de 100644 --- a/loader/src/injector/unmount.cpp +++ b/loader/src/injector/unmount.cpp @@ -10,7 +10,7 @@ static void lazy_unmount(const char* mountpoint) { if (umount2(mountpoint, MNT_DETACH) != -1) { LOGD("Unmounted (%s)", mountpoint); } else { - PLOGE("Failed to unmount: %s (%s)", strerror(errno), mountpoint); + LOGW("Failed to unmount: %s (%s)", strerror(errno), mountpoint); } } @@ -45,11 +45,9 @@ void revert_unmount() { parse_mnt("/proc/self/mounts", [&](mntent* mentry) { if (mentry->mnt_type == "overlay"sv) { - for (auto it = backups.begin(); it != backups.end(); it++) { - backups.remove_if([&](auto& mnt) { - return mnt.first == mentry->mnt_dir && mnt.second == mentry->mnt_opts; - }); - } + backups.remove_if([&](auto& mnt) { + return mnt.first == mentry->mnt_dir && mnt.second == mentry->mnt_opts; + }); } return true; });