mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-12-22 23:26:42 -08:00
Fix SAR support for overlay.d
This commit is contained in:
@@ -13,10 +13,13 @@
|
||||
#include <unistd.h>
|
||||
#include <syscall.h>
|
||||
#include <random>
|
||||
#include <string>
|
||||
|
||||
#include <logging.hpp>
|
||||
#include <utils.hpp>
|
||||
|
||||
using namespace std;
|
||||
|
||||
int fork_dont_care() {
|
||||
int pid = xfork();
|
||||
if (pid) {
|
||||
@@ -214,3 +217,12 @@ int switch_mnt_ns(int pid) {
|
||||
close(fd);
|
||||
return ret;
|
||||
}
|
||||
|
||||
string &replace_all(string &str, string_view from, string_view to) {
|
||||
size_t pos = 0;
|
||||
while((pos = str.find(from, pos)) != string::npos) {
|
||||
str.replace(pos, from.length(), to);
|
||||
pos += to.length();
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user