Mercurial > minori
diff dep/animia/src/fd/linux.cc @ 154:d43d68408d3c
dep/animia: fix XnuFdTools
also we use anitomy directly now.
HG Enter commit message. Lines beginning with 'HG:' are removed.
author | Paper <mrpapersonic@gmail.com> |
---|---|
date | Wed, 15 Nov 2023 14:14:17 -0500 |
parents | 8700806c2cc2 |
children | cdf79282d647 |
line wrap: on
line diff
--- a/dep/animia/src/fd/linux.cc Wed Nov 15 13:28:18 2023 -0500 +++ b/dep/animia/src/fd/linux.cc Wed Nov 15 14:14:17 2023 -0500 @@ -99,14 +99,17 @@ return ret.c_str(); } -static bool GetProcessName(pid_t pid, std::string& result) { +static std::string GetProcessName(pid_t pid) { const std::string path = PROC_LOCATION "/" + std::to_string(pid) + "/comm"; + std::string result; + if (!util::ReadFile(path, result)) - return false; + return ""; result.erase(std::remove(result.begin(), result.end(), '\n'), result.end()); - return true; + + return result; } bool LinuxFdTools::EnumerateOpenProcesses(process_proc_t process_proc) {