diff --git a/src/conf.h b/src/conf.h index 308b110b..e09dbbc4 100644 --- a/src/conf.h +++ b/src/conf.h @@ -36,9 +36,7 @@ #define CONF_E_BADCONFIG 12 #define CONF_E_NOTSUPP 13 -extern int conf_read(char *file); extern int conf_reload(void); -extern int conf_close(void); extern int conf_get_int(char *section, char *key, int dflt); extern int conf_get_string(char *section, char *key, char *dflt, char *out, int *size); diff --git a/src/conffile.c b/src/conffile.c index 7a5f7472..cd303393 100644 --- a/src/conffile.c +++ b/src/conffile.c @@ -336,19 +336,6 @@ conffile_unload(void) /* Wrappers for old configfile handling */ #include "conf.h" -int -conf_read(char *file) -{ - return conffile_load(file); -} - -int -conf_close(void) -{ - conffile_unload(); - return 0; -} - int conf_get_int(char *section, char *key, int dflt) { diff --git a/src/main.c b/src/main.c index 02c2d898..66f72a37 100644 --- a/src/main.c +++ b/src/main.c @@ -82,6 +82,7 @@ #include "daapd.h" +#include "conffile.h" #include "conf.h" #include "configfile.h" #include "err.h" @@ -591,10 +592,13 @@ int main(int argc, char *argv[]) { config.stats.start_time=start_time=(int)time(NULL); config.stop=0; - if(CONF_E_SUCCESS != conf_read(configfile)) { - fprintf(stderr,"Error reading config file (%s)\n",configfile); - exit(EXIT_FAILURE); - } + ret = conffile_load(configfile); + if (ret != 0) + { + fprintf(stderr, "Config file errors; please fix your config\n"); + + exit(EXIT_FAILURE); + } if(debuglevel) /* was specified, should override the config file */ err_setlevel(debuglevel); @@ -842,7 +846,8 @@ int main(int argc, char *argv[]) { ws_stop(config.server); */ free(web_root); - conf_close(); + + conffile_unload(); DPRINTF(E_LOG,L_MAIN|L_DB,"Closing database\n"); db_deinit();