File tree Expand file tree Collapse file tree 1 file changed +14
-10
lines changed
buildcc/lib/toolchain/src/api Expand file tree Collapse file tree 1 file changed +14
-10
lines changed Original file line number Diff line number Diff line change 20
20
#include < unordered_set>
21
21
#include < vector>
22
22
23
+ #include < iostream>
24
+
23
25
#include " toolchain/toolchain.h"
24
26
25
27
#include " env/assert_fatal.h"
@@ -207,18 +209,20 @@ ToolchainVerify<T>::Verify(const VerifyToolchainConfig &config) {
207
209
continue ;
208
210
}
209
211
212
+ std::error_code ec;
213
+ auto directory_iterator = fs::directory_iterator (p, ec);
214
+ if (ec) {
215
+ continue ;
216
+ }
217
+
210
218
// For each directory, Check if ALL toolchain filenames are found
211
- for (const auto &dir_iter : fs::directory_iterator (p)) {
212
- try {
213
- if (!dir_iter.is_regular_file ()) {
214
- continue ;
215
- }
216
- const auto &filename = dir_iter.path ().filename ().string ();
217
- matcher.Check (filename);
218
- } catch (const std::exception &e) {
219
- // NOTE, Certain paths might not be accessible i.e restricted
220
- env::log_critical (__FUNCTION__, e.what ());
219
+ for (const auto &dir_iter : directory_iterator) {
220
+ bool is_regular_file = dir_iter.is_regular_file (ec);
221
+ if (!is_regular_file || ec) {
222
+ continue ;
221
223
}
224
+ const auto &filename = dir_iter.path ().filename ().string ();
225
+ matcher.Check (filename);
222
226
}
223
227
224
228
// Store verified toolchain path if found
You can’t perform that action at this time.
0 commit comments