diff options
| author | 2019-07-16 11:56:21 -0700 | |
|---|---|---|
| committer | 2019-07-16 11:56:21 -0700 | |
| commit | ca8c3dedaf080ce76d6fd0cae959a01880df073b (patch) | |
| tree | 097a37bb2665bc6f5f27c97ca5c8f15670ba2902 /cmds/dumpstate/DumpstateUtil.cpp | |
| parent | bfafdc2ee70aadcda10a157db578265cbec88170 (diff) | |
| parent | a152e0f75fc859d738ab587a46697bbf8a281bab (diff) | |
Merge "Remove unused function GetPidByName()"
am: a152e0f75f
Change-Id: I7ac2e52d3ec95f048171fe67554f34c137f6ba7a
Diffstat (limited to 'cmds/dumpstate/DumpstateUtil.cpp')
| -rw-r--r-- | cmds/dumpstate/DumpstateUtil.cpp | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/cmds/dumpstate/DumpstateUtil.cpp b/cmds/dumpstate/DumpstateUtil.cpp index 97c8ae2045..4b69607156 100644 --- a/cmds/dumpstate/DumpstateUtil.cpp +++ b/cmds/dumpstate/DumpstateUtil.cpp @@ -378,34 +378,6 @@ int RunCommandToFd(int fd, const std::string& title, const std::vector<std::stri return status; } -int GetPidByName(const std::string& ps_name) { - DIR* proc_dir; - struct dirent* ps; - unsigned int pid; - std::string cmdline; - - if (!(proc_dir = opendir("/proc"))) { - MYLOGE("Can't open /proc\n"); - return -1; - } - - while ((ps = readdir(proc_dir))) { - if (!(pid = atoi(ps->d_name))) { - continue; - } - android::base::ReadFileToString("/proc/" + std::string(ps->d_name) + "/cmdline", &cmdline); - if (cmdline.find(ps_name) == std::string::npos) { - continue; - } else { - closedir(proc_dir); - return pid; - } - } - MYLOGE("can't find the pid\n"); - closedir(proc_dir); - return -1; -} - } // namespace dumpstate } // namespace os } // namespace android |