mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-10-16 09:29:58 +00:00
Micro optimizations
This commit is contained in:
@@ -72,9 +72,10 @@ static void hide_daemon(int pid) {
|
||||
if (switch_mnt_ns(pid))
|
||||
goto exit;
|
||||
|
||||
snprintf(buffer, sizeof(buffer), "/proc/%d/mounts", pid);
|
||||
file_to_vector(buffer, mounts);
|
||||
snprintf(buffer, sizeof(buffer), "/proc/%d", pid);
|
||||
chdir(buffer);
|
||||
|
||||
file_to_vector("mounts", mounts);
|
||||
// Unmount dummy skeletons and /sbin links
|
||||
for (auto &s : mounts) {
|
||||
if (s.contains("tmpfs /system/") || s.contains("tmpfs /vendor/") || s.contains("tmpfs /sbin")) {
|
||||
@@ -85,8 +86,7 @@ static void hide_daemon(int pid) {
|
||||
mounts.clear();
|
||||
|
||||
// Re-read mount infos
|
||||
snprintf(buffer, sizeof(buffer), "/proc/%d/mounts", pid);
|
||||
file_to_vector(buffer, mounts);
|
||||
file_to_vector("mounts", mounts);
|
||||
|
||||
// Unmount everything under /system, /vendor, and loop mounts
|
||||
for (auto &s : mounts) {
|
||||
|
Reference in New Issue
Block a user