Merge pull request #5021 from Sonicadvance1/fix_dir_iter

pidof: Fixes another unexpected throw location
This commit is contained in:
LC authored and GitHub committed 2025-11-04 15:10:07 -05:00
commit cbe2b442b2
1 file changed
+9 -2
+9 -2
View File
@@ -87,13 +87,20 @@ bool FindWineFEXApplication(int64_t PID, std::string_view exe, const std::vector
}
// Wine was found, scan the mapped files to see if anything mapped "libarm64ecfex.dll" or "libwow64fex.dll"
for (const auto& Entry : std::filesystem::directory_iterator(fmt::format("/proc/{}/map_files", PID))) {
std::error_code ec {};
auto dir_iter = std::filesystem::directory_iterator(fmt::format("/proc/{}/map_files", PID), ec);
// If error reading symlink then skip.
if (ec) {
return false;
}
for (const auto& Entry : dir_iter) {
// If not a symlink then skip.
if (!Entry.is_symlink()) {
continue;
}
std::error_code ec {};
const auto symlink_path = std::filesystem::read_symlink(Entry.path(), ec);
// If error reading symlink then skip.
if (ec) {