main: put initialization of config defaults into a function of its own
Michael
This commit is contained in:
parent
ea2eaef173
commit
8945d9f0ae
23
src/main.c
23
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
|
int
|
||||||
main (int argc, char **argv)
|
main (int argc, char **argv)
|
||||||
{
|
{
|
||||||
FILE *config_file;
|
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
/* Only allow u+rw bits. This may be required for some versions
|
/* Only allow u+rw bits. This may be required for some versions
|
||||||
@ -312,14 +324,7 @@ main (int argc, char **argv)
|
|||||||
*/
|
*/
|
||||||
umask (0177);
|
umask (0177);
|
||||||
|
|
||||||
config.config_file = SYSCONFDIR "/tinyproxy.conf";
|
initialize_config_defaults (&config);
|
||||||
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;
|
|
||||||
|
|
||||||
process_cmdline (argc, argv);
|
process_cmdline (argc, argv);
|
||||||
|
|
||||||
log_message (LOG_INFO, "Initializing " PACKAGE " ...");
|
log_message (LOG_INFO, "Initializing " PACKAGE " ...");
|
||||||
|
Loading…
Reference in New Issue
Block a user