Commit a74b368c authored by Alastair Robertson's avatar Alastair Robertson

Better error message when unable to open files

parent 5d00cea5
......@@ -99,6 +99,12 @@ std::set<std::string> BPFtrace::find_wildcard_matches(const std::string &prefix,
std::smatch match;
std::ifstream file(file_name);
if (file.fail())
{
std::cerr << strerror(errno) << ": " << file_name << std::endl;
return std::set<std::string>();
}
std::string line;
std::set<std::string> matches;
while (std::getline(file, line))
......
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