Skip to content

Commit a01020c

Browse files
author
tby
committed
Fix: Abnormal exit on Android devices due to file access permission issues
1 parent 42eb248 commit a01020c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

ggml/src/ggml-backend-reg.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,8 @@ static ggml_backend_reg_t ggml_backend_load_best(const char * name, bool silent,
510510
}
511511
fs::directory_iterator dir_it(search_path, fs::directory_options::skip_permission_denied);
512512
for (const auto & entry : dir_it) {
513-
if (entry.is_regular_file()) {
513+
std::error_code ec;
514+
if (entry.is_regular_file(ec)) {
514515
auto filename = entry.path().filename();
515516
auto ext = entry.path().extension();
516517
if (filename.native().find(file_prefix) == 0 && ext == file_extension) {

0 commit comments

Comments
 (0)