summaryrefslogtreecommitdiffhomepage
path: root/src/main.c
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2009-11-08 23:41:21 +0100
committerMichael Adam <obnox@samba.org>2009-11-14 12:13:10 +0100
commitfba81e417422abb249efa6576b3e3af6e9b044ed (patch)
treeacf1278a997165d66f5b0a3c6024c25fd2dc8496 /src/main.c
parenta09dd9cd00f0752ff14b326d556073904f095ed7 (diff)
conf: refactor loading of config file out into load_config_file()
and make config_compile and config_parse static to conf.c Michael
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c16
1 files changed, 2 insertions, 14 deletions
diff --git a/src/main.c b/src/main.c
index 3427fc9..abf52f9 100644
--- a/src/main.c
+++ b/src/main.c
@@ -329,23 +329,11 @@ main (int argc, char **argv)
log_message (LOG_INFO, "Initializing " PACKAGE " ...");
- /* Read in the settings from the config file */
- config_file = fopen (config.config_file, "r");
- if (!config_file) {
- fprintf (stderr,
- "%s: Could not open config file \"%s\".\n",
- argv[0], config.config_file);
- exit (EX_SOFTWARE);
- }
-
- if (config_compile () || config_parse (&config, config_file)) {
- fprintf (stderr, "Unable to parse config file. "
- "Not starting.\n");
+ ret = load_config_file(config.config_file, &config);
+ if (ret != 0) {
exit (EX_SOFTWARE);
}
- fclose (config_file);
-
ret = setup_logging ();
if (ret != 0) {
exit (EX_SOFTWARE);