Commit 2900d17e authored by aligungr's avatar aligungr

CLI improvements

parent e347ef30
...@@ -64,6 +64,8 @@ static uint16_t DiscoverNode(const std::string &node) ...@@ -64,6 +64,8 @@ static uint16_t DiscoverNode(const std::string &node)
entries[file.path()] = app::ProcTableEntry::Decode(content); entries[file.path()] = app::ProcTableEntry::Decode(content);
} }
uint16_t found = 0;
for (auto &e : entries) for (auto &e : entries)
{ {
// If no such process, it means that this ProcTable file is outdated // If no such process, it means that this ProcTable file is outdated
...@@ -78,12 +80,11 @@ static uint16_t DiscoverNode(const std::string &node) ...@@ -78,12 +80,11 @@ static uint16_t DiscoverNode(const std::string &node)
for (auto &n : e.second.nodes) for (auto &n : e.second.nodes)
{ {
if (n == node) // TODO: version checking if (n == node) // TODO: version checking
return e.second.port; found = e.second.port;
} }
} }
// No process found for this node name return found;
return 0;
} }
static std::vector<std::string> DumpNames() static std::vector<std::string> DumpNames()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment