aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/utils/prefs.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'host/lib/utils/prefs.cpp')
-rw-r--r--host/lib/utils/prefs.cpp20
1 files changed, 13 insertions, 7 deletions
diff --git a/host/lib/utils/prefs.cpp b/host/lib/utils/prefs.cpp
index ef920cf29..63479c911 100644
--- a/host/lib/utils/prefs.cpp
+++ b/host/lib/utils/prefs.cpp
@@ -23,13 +23,19 @@ namespace {
config_parser& conf_file
) {
if (not path.empty()) {
- UHD_LOG_TRACE("PREFS", "Trying to load " << path);
- try {
- conf_file.read_file(path);
- UHD_LOG_DEBUG("PREFS",
- "Loaded " << config_type << " config file " << path);
- } catch (...) {
- // nop
+ UHD_LOG_TRACE("PREFS", "Trying to load " << path);
+ if (boost::filesystem::exists(path)) {
+ try {
+ conf_file.read_file(path);
+ UHD_LOG_DEBUG("PREFS",
+ "Loaded " << config_type << " config file " << path);
+ } catch (...) {
+ UHD_LOG_DEBUG("PREFS",
+ "Failed to load " << config_type << " config file " << path);
+ }
+ } else {
+ UHD_LOG_TRACE("PREFS",
+ "No " << config_type << " config file found at " << path);
}
}
}