SCSI Dump Usability Enhancements & Cleanup (#1026)

Co-authored-by: Tony Kuker <akuker@gmail.com>
This commit is contained in:
akuker
2022-12-09 09:50:45 -06:00
committed by GitHub
parent 35447cc1c6
commit 5b3626dcf5
11 changed files with 655 additions and 443 deletions
+8 -3
View File
@@ -34,16 +34,21 @@ FILE *__wrap_fopen(const char *__restrict __filename, const char *__restrict __m
#endif
{
path new_filename;
auto in_filename = path(__filename);
bool create_directory = false;
// If we're trying to open up the device tree soc ranges,
// re-direct it to a temporary local file.
if (string(__filename) == "/proc/device-tree/soc/ranges") {
if ((string(__filename) == "/proc/device-tree/soc/ranges") ||
(string(__filename).find(".properties") != string::npos)) {
create_directory = true;
new_filename = test_data_temp_path;
new_filename += path(__filename);
if (!in_filename.has_parent_path()) {
new_filename += "/";
}
new_filename += in_filename;
} else {
new_filename = path(__filename);
new_filename = in_filename;
}
if (create_directory) {