--- src/haproxy.c | 9 ++++++++- src/proxy.c | 6 +++--- 2 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/src/haproxy.c b/src/haproxy.c index a0bc8f5..4ee7161 100644 --- a/src/haproxy.c +++ b/src/haproxy.c @@ -103,7 +103,8 @@ int pid; /* current process id */ int relative_pid = 1; /* process id starting at 1 */ /* global options */ -struct global global = { +struct global global; +struct global global_default = { logfac1 : -1, logfac2 : -1, loglev1 : 7, /* max syslog level : debug */ @@ -370,6 +371,12 @@ void init(int argc, char **argv) struct wordlist *wl; char *progname; + global = global_default; + proxy = NULL; + used_proxy_id = EB_ROOT; + error_snapshot_id = 0; + jobs = 0; + /* NB: POSIX does not make it mandatory for gethostname() to NULL-terminate * the string in case of truncation, and at least FreeBSD appears not to do * it. diff --git a/src/proxy.c b/src/proxy.c index 0c6640e..c4f452c 100644 --- a/src/proxy.c +++ b/src/proxy.c @@ -41,9 +41,9 @@ int listeners; /* # of proxy listeners, set by cfgparse, unset by maintain_proxies */ -struct proxy *proxy = NULL; /* list of all existing proxies */ -struct eb_root used_proxy_id = EB_ROOT; /* list of proxy IDs in use */ -unsigned int error_snapshot_id = 0; /* global ID assigned to each error then incremented */ +struct proxy *proxy; /* list of all existing proxies */ +struct eb_root used_proxy_id; /* list of proxy IDs in use */ +unsigned int error_snapshot_id; /* global ID assigned to each error then incremented */ /* * This function returns a string containing a name describing capabilities to -- 1.7.2.3