Update zygote namespace

Close #1492
This commit is contained in:
topjohnwu 2019-05-25 18:30:43 -07:00
parent bb15671046
commit dad20f6a2d

View File

@ -362,14 +362,18 @@ static bool check_pid(int pid) {
} }
static void new_zygote(int pid) { static void new_zygote(int pid) {
if (zygote_map.count(pid))
return;
LOGD("proc_monitor: ptrace zygote PID=[%d]\n", pid);
struct stat st; struct stat st;
if (read_ns(pid, &st)) if (read_ns(pid, &st))
return; return;
auto it = zygote_map.find(pid);
if (it != zygote_map.end()) {
// Update namespace info
it->second = st;
return;
}
LOGD("proc_monitor: ptrace zygote PID=[%d]\n", pid);
zygote_map[pid] = st; zygote_map[pid] = st;
xptrace(PTRACE_ATTACH, pid); xptrace(PTRACE_ATTACH, pid);