Add cgroup2 path
https://android-review.googlesource.com/c/platform/system/core/+/1585101
This commit is contained in:
parent
5e56a6bbee
commit
ac8372dd26
@ -247,8 +247,15 @@ static void daemon_entry(int ppid) {
|
|||||||
// Make sure ppid is not in acct
|
// Make sure ppid is not in acct
|
||||||
char src[64], dest[64];
|
char src[64], dest[64];
|
||||||
sprintf(src, "/acct/uid_0/pid_%d", ppid);
|
sprintf(src, "/acct/uid_0/pid_%d", ppid);
|
||||||
|
if (access(src, F_OK) == 0) {
|
||||||
sprintf(dest, "/acct/uid_0/pid_%d", getpid());
|
sprintf(dest, "/acct/uid_0/pid_%d", getpid());
|
||||||
rename(src, dest);
|
rename(src, dest);
|
||||||
|
}
|
||||||
|
sprintf(src, "/sys/fs/cgroup/uid_0/pid_%d", ppid);
|
||||||
|
if (access(src, F_OK) == 0) {
|
||||||
|
sprintf(dest, "/sys/fs/cgroup/uid_0/pid_%d", getpid());
|
||||||
|
rename(src, dest);
|
||||||
|
}
|
||||||
|
|
||||||
// Get self stat
|
// Get self stat
|
||||||
xreadlink("/proc/self/exe", src, sizeof(src));
|
xreadlink("/proc/self/exe", src, sizeof(src));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user