mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-01-15 19:55:47 +00:00
Fix volk_gnsssdr_profile if config file does not exist
This commit is contained in:
parent
c89247026a
commit
edbe7b4840
@ -253,7 +253,16 @@ void write_results(const std::vector<volk_gnsssdr_test_results_t> *results, bool
|
||||
if (!fs::exists(config_path.parent_path()))
|
||||
{
|
||||
std::cout << "Creating " << config_path.parent_path() << " ..." << std::endl;
|
||||
fs::create_directories(config_path.parent_path());
|
||||
try
|
||||
{
|
||||
fs::create_directories(config_path.parent_path());
|
||||
}
|
||||
catch (const fs::filesystem_error &e)
|
||||
{
|
||||
std::cerr << "ERROR: Could not create folder " << config_path.parent_path() << std::endl;
|
||||
std::cerr << "Reason: " << e.what() << std::endl;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
std::ofstream config;
|
||||
|
@ -77,6 +77,15 @@ void volk_gnsssdr_get_config_path(char *path)
|
||||
return;
|
||||
}
|
||||
|
||||
// if nothing exists, write to HOME or APPDATA
|
||||
home = getenv("HOME");
|
||||
if (home == NULL) home = getenv("APPDATA");
|
||||
if (home != NULL)
|
||||
{
|
||||
strncpy(path, home, 512);
|
||||
strcat(path, suffix);
|
||||
return;
|
||||
}
|
||||
path[0] = 0;
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user