Skip to content

Commit

Permalink
Added a hardcoded fallback path to improve file access reliability. I…
Browse files Browse the repository at this point in the history
…f the initial attempt to open the specified file fails, the code now attempts to open a default path "mc0:/neutrino/". This ensures that the application can still function correctly even when the primary file is inaccessible, enhancing overall error handling.
  • Loading branch information
AKuHAK committed Oct 9, 2024
1 parent c8c265f commit 6869eed
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions ee/loader/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -689,8 +689,13 @@ int load_driver(const char * type, const char * subtype)
snprintf(filename, 256, "config/%s.toml", type);
fp = fopen(filename, "r");
if (!fp) {
printf("ERROR: %s: failed to open\n", filename);
goto err_exit;
printf("ERROR: %s: failed to open, trying default path...\n", filename);
chdir("mc0:/neutrino/");
fp = fopen(filename, "r");
if (!fp) {
printf("ERROR: %s: failed to open\n", filename);
goto err_exit;
}
}
tbl_root = toml_parse_file(fp, errbuf, sizeof(errbuf));
fclose(fp);
Expand Down

0 comments on commit 6869eed

Please sign in to comment.