Commit ac8372dd authored by vvb2060's avatar vvb2060 Committed by John Wu
parent 5e56a6bb
......@@ -247,8 +247,15 @@ static void daemon_entry(int ppid) {
// Make sure ppid is not in acct
char src[64], dest[64];
sprintf(src, "/acct/uid_0/pid_%d", ppid);
sprintf(dest, "/acct/uid_0/pid_%d", getpid());
rename(src, dest);
if (access(src, F_OK) == 0) {
sprintf(dest, "/acct/uid_0/pid_%d", getpid());
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
xreadlink("/proc/self/exe", src, sizeof(src));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment