summaryrefslogtreecommitdiffhomepage
path: root/src/main.c
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2009-11-08 23:39:24 +0100
committerMichael Adam <obnox@samba.org>2009-11-14 12:13:10 +0100
commit8945d9f0aeff9c850bc13359aa38ac7f9ad78f58 (patch)
tree422c04a6a627af23a0bf39db275e84fb3f3c49af /src/main.c
parentea2eaef173b56213fe58f42b9478164f7abdbfb7 (diff)
main: put initialization of config defaults into a function of its own
Michael
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c23
1 files changed, 14 insertions, 9 deletions
diff --git a/src/main.c b/src/main.c
index b00e359..51eb854 100644
--- a/src/main.c
+++ b/src/main.c
@@ -301,10 +301,22 @@ change_user (const char *program)
}
}
+static void initialize_config_defaults (struct config_s *conf)
+{
+ memset (conf, 0, sizeof(*conf));
+
+ conf->config_file = SYSCONFDIR "/tinyproxy.conf";
+ conf->godaemon = TRUE;
+ /*
+ * Make sure the HTML error pages array is NULL to begin with.
+ * (FIXME: Should have a better API for all this)
+ */
+ conf->errorpages = NULL;
+}
+
int
main (int argc, char **argv)
{
- FILE *config_file;
int ret;
/* Only allow u+rw bits. This may be required for some versions
@@ -312,14 +324,7 @@ main (int argc, char **argv)
*/
umask (0177);
- config.config_file = SYSCONFDIR "/tinyproxy.conf";
- config.godaemon = TRUE;
- /*
- * Make sure the HTML error pages array is NULL to begin with.
- * (FIXME: Should have a better API for all this)
- */
- config.errorpages = NULL;
-
+ initialize_config_defaults (&config);
process_cmdline (argc, argv);
log_message (LOG_INFO, "Initializing " PACKAGE " ...");