mirror of
https://github.com/owntone/owntone-server.git
synced 2025-01-14 00:05:03 -05:00
Use new conffile code in main.c; remove wrappers
This commit is contained in:
parent
bacdddb82f
commit
bbab963fe2
@ -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);
|
||||
|
@ -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)
|
||||
{
|
||||
|
15
src/main.c
15
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();
|
||||
|
Loading…
Reference in New Issue
Block a user