diff options
| author | 2019-05-21 00:24:34 +0000 | |
|---|---|---|
| committer | 2019-05-21 00:24:34 +0000 | |
| commit | 8523a7af849dcee34aa6e0c56e34033ffa19f62e (patch) | |
| tree | 15ffd96e6e541999a2a3c7c0f216cc1ddcc97277 | |
| parent | c6af53022abf90a2574903fd411b6236fd1e1e94 (diff) | |
| parent | 33e622a58a10e997c47a2c07c60240552563e216 (diff) | |
Merge "Update IsZygote to return true for USAPs." into qt-dev
| -rw-r--r-- | libs/dumputils/dump_utils.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/libs/dumputils/dump_utils.cpp b/libs/dumputils/dump_utils.cpp index 26c2a0d802..a00459d352 100644 --- a/libs/dumputils/dump_utils.cpp +++ b/libs/dumputils/dump_utils.cpp @@ -110,13 +110,15 @@ std::set<int> get_interesting_hal_pids() { } bool IsZygote(int pid) { - static const std::string kZygotePrefix = "zygote"; - std::string cmdline; if (!android::base::ReadFileToString(android::base::StringPrintf("/proc/%d/cmdline", pid), &cmdline)) { return true; } - return (cmdline.find(kZygotePrefix) == 0); + // cmdline has embedded nulls; only consider argv[0]. + cmdline = std::string(cmdline.c_str()); + + return cmdline == "zygote" || cmdline == "zygote64" || cmdline == "usap32" || + cmdline == "usap64"; } |