Mercurial > minori
comparison dep/animia/src/fd/linux.cc @ 148:aa4df5a84338
dep/animia: use std::pair instead of std::tuple
author | Paper <mrpapersonic@gmail.com> |
---|---|
date | Tue, 14 Nov 2023 13:27:13 -0500 |
parents | 8e9b71970bda |
children | ffa535b6d630 |
comparison
equal
deleted
inserted
replaced
147:6fdf0632c003 | 148:aa4df5a84338 |
---|---|
122 | 122 |
123 result.erase(std::remove(result.begin(), result.end(), '\n'), result.end()); | 123 result.erase(std::remove(result.begin(), result.end(), '\n'), result.end()); |
124 return true; | 124 return true; |
125 } | 125 } |
126 | 126 |
127 bool LinuxFdTools::EnumerateOpenFiles(const std::set<pid_t>& pids, std::vector<std::tuple<pid_t, std::string>>& files) { | 127 bool LinuxFdTools::EnumerateOpenFiles(const std::set<pid_t>& pids, std::vector<std::pair<pid_t, std::string>>& files) { |
128 for (const auto& pid : pids) { | 128 for (const auto& pid : pids) { |
129 const std::string path = PROC_LOCATION "/" + std::to_string(pid) + "/fd"; | 129 const std::string path = PROC_LOCATION "/" + std::to_string(pid) + "/fd"; |
130 | 130 |
131 for (const auto& dir : GetAllFilesInDir(path)) { | 131 for (const auto& dir : GetAllFilesInDir(path)) { |
132 if (!AreFlagsOk(pid, std::stoi(Basename(dir)))) | 132 if (!AreFlagsOk(pid, std::stoi(Basename(dir)))) |