summaryrefslogtreecommitdiff
path: root/src/common/conf.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/conf.c')
-rw-r--r--src/common/conf.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/common/conf.c b/src/common/conf.c
index 25f1013f5..9188affa4 100644
--- a/src/common/conf.c
+++ b/src/common/conf.c
@@ -24,6 +24,7 @@
#include "common/showmsg.h" // ShowError
#include "common/strlib.h" // safestrncpy
+#include "common/utils.h" // exists
#include <libconfig/libconfig.h>
@@ -46,6 +47,10 @@ struct libconfig_interface *libconfig;
int config_load_file(struct config_t *config, const char *config_filename)
{
libconfig->init(config);
+ if (!exists(config_filename)) {
+ ShowError("Unable to load '%s' - File not found\n", config_filename);
+ return CONFIG_FALSE;
+ }
if (libconfig->read_file_src(config, config_filename) != CONFIG_TRUE) {
ShowError("%s:%d - %s\n", config_error_file(config),
config_error_line(config), config_error_text(config));