summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
Diffstat (limited to 'src/common')
-rw-r--r--src/common/HPM.c2
-rw-r--r--src/common/conf.c16
-rw-r--r--src/common/conf.h2
-rw-r--r--src/common/socket.c2
4 files changed, 12 insertions, 10 deletions
diff --git a/src/common/HPM.c b/src/common/HPM.c
index d9c3262d7..0cb23019a 100644
--- a/src/common/HPM.c
+++ b/src/common/HPM.c
@@ -628,7 +628,7 @@ void hplugins_config_read(void) {
fclose(fp);
}
- if (libconfig->read_file(&plugins_conf, config_filename))
+ if (!libconfig->load_file(&plugins_conf, config_filename))
return;
plist = libconfig->lookup(&plugins_conf, "plugins_list");
diff --git a/src/common/conf.c b/src/common/conf.c
index b7c4f0734..ca9b7cbbc 100644
--- a/src/common/conf.c
+++ b/src/common/conf.c
@@ -32,7 +32,7 @@ struct libconfig_interface libconfig_s;
struct libconfig_interface *libconfig;
/**
- * Initializes 'config' and reads a configuration file.
+ * Initializes 'config' and loads a configuration file.
*
* Shows error and destroys 'config' in case of failure.
* It is the caller's care to destroy 'config' in case of success.
@@ -40,17 +40,19 @@ struct libconfig_interface *libconfig;
* @param config The config file to initialize.
* @param config_filename The file to read.
*
- * @retval 1 in case of failure.
+ * @retval CONFIG_TRUE in case of success.
+ * @retval CONFIG_FALSE in case of failure.
*/
-int conf_read_file(config_t *config, const char *config_filename) {
+int config_load_file(config_t *config, const char *config_filename)
+{
libconfig->init(config);
- if (!libconfig->read_file_src(config, config_filename)) {
+ 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));
libconfig->destroy(config);
- return 1;
+ return CONFIG_FALSE;
}
- return 0;
+ return CONFIG_TRUE;
}
//
@@ -436,7 +438,7 @@ void libconfig_defaults(void) {
libconfig->lookup_bool = config_lookup_bool;
libconfig->lookup_string = config_lookup_string;
/* those are custom and are from src/common/conf.c */
- libconfig->read_file = conf_read_file;
+ libconfig->load_file = config_load_file;
libconfig->setting_copy_simple = config_setting_copy_simple;
libconfig->setting_copy_elem = config_setting_copy_elem;
libconfig->setting_copy_aggregate = config_setting_copy_aggregate;
diff --git a/src/common/conf.h b/src/common/conf.h
index 8bec2704f..3bcb4526f 100644
--- a/src/common/conf.h
+++ b/src/common/conf.h
@@ -100,7 +100,7 @@ struct libconfig_interface {
/* those are custom and are from src/common/conf.c */
/* Functions to copy settings from libconfig/contrib */
- int (*read_file) (config_t *config, const char *config_filename);
+ int (*load_file) (config_t *config, const char *config_filename);
void (*setting_copy_simple) (config_setting_t *parent, const config_setting_t *src);
void (*setting_copy_elem) (config_setting_t *parent, const config_setting_t *src);
void (*setting_copy_aggregate) (config_setting_t *parent, const config_setting_t *src);
diff --git a/src/common/socket.c b/src/common/socket.c
index 740c07bdc..be144fd50 100644
--- a/src/common/socket.c
+++ b/src/common/socket.c
@@ -1726,7 +1726,7 @@ void socket_net_config_read(const char *filename)
int i;
nullpo_retv(filename);
- if (libconfig->read_file(&network_config, filename)) {
+ if (!libconfig->load_file(&network_config, filename)) {
ShowError("LAN Support configuration file is not found: '%s'. This server won't be able to accept connections from any servers.\n", filename);
return;
}