remove godaemon member from config structure
since this option can't be set via config file, it makes sense to factor it out and use it only where strictly needed, e.g. in startup code.
This commit is contained in:
parent
eb2104e1ff
commit
180c0664aa
@ -451,7 +451,6 @@ void initialize_config_defaults (struct config_s *conf)
|
|||||||
fprintf (stderr, PACKAGE ": Could not allocate memory.\n");
|
fprintf (stderr, PACKAGE ": Could not allocate memory.\n");
|
||||||
exit (EX_SOFTWARE);
|
exit (EX_SOFTWARE);
|
||||||
}
|
}
|
||||||
conf->godaemon = TRUE;
|
|
||||||
/*
|
/*
|
||||||
* Make sure the HTML error pages array is NULL to begin with.
|
* Make sure the HTML error pages array is NULL to begin with.
|
||||||
* (FIXME: Should have a better API for all this)
|
* (FIXME: Should have a better API for all this)
|
||||||
@ -482,7 +481,6 @@ static void initialize_with_defaults (struct config_s *conf,
|
|||||||
conf->stathost = safestrdup (defaults->stathost);
|
conf->stathost = safestrdup (defaults->stathost);
|
||||||
}
|
}
|
||||||
|
|
||||||
conf->godaemon = defaults->godaemon;
|
|
||||||
conf->quit = defaults->quit;
|
conf->quit = defaults->quit;
|
||||||
|
|
||||||
if (defaults->user) {
|
if (defaults->user) {
|
||||||
|
@ -43,7 +43,6 @@ struct config_s {
|
|||||||
unsigned int syslog; /* boolean */
|
unsigned int syslog; /* boolean */
|
||||||
unsigned int port;
|
unsigned int port;
|
||||||
char *stathost;
|
char *stathost;
|
||||||
unsigned int godaemon; /* boolean */
|
|
||||||
unsigned int quit; /* boolean */
|
unsigned int quit; /* boolean */
|
||||||
unsigned int maxclients;
|
unsigned int maxclients;
|
||||||
char *user;
|
char *user;
|
||||||
|
@ -263,7 +263,7 @@ done:
|
|||||||
int
|
int
|
||||||
main (int argc, char **argv)
|
main (int argc, char **argv)
|
||||||
{
|
{
|
||||||
int opt;
|
int opt, daemonized = TRUE;
|
||||||
|
|
||||||
srand(time(NULL)); /* for hashmap seeds */
|
srand(time(NULL)); /* for hashmap seeds */
|
||||||
|
|
||||||
@ -287,7 +287,7 @@ main (int argc, char **argv)
|
|||||||
exit (EX_OK);
|
exit (EX_OK);
|
||||||
|
|
||||||
case 'd':
|
case 'd':
|
||||||
(&config_defaults)->godaemon = FALSE;
|
daemonized = FALSE;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'c':
|
case 'c':
|
||||||
@ -330,7 +330,7 @@ main (int argc, char **argv)
|
|||||||
anonymous_insert ("Content-Type");
|
anonymous_insert ("Content-Type");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (config.godaemon == TRUE) {
|
if (daemonized == TRUE) {
|
||||||
if (!config.syslog && config.logf_name == NULL)
|
if (!config.syslog && config.logf_name == NULL)
|
||||||
fprintf(stderr, "WARNING: logging deactivated "
|
fprintf(stderr, "WARNING: logging deactivated "
|
||||||
"(can't log to stdout when daemonized)\n");
|
"(can't log to stdout when daemonized)\n");
|
||||||
|
Loading…
Reference in New Issue
Block a user