diff options
author | Luke Bratch <luke@bratch.co.uk> | 2019-05-29 21:44:25 +0100 |
---|---|---|
committer | Luke Bratch <luke@bratch.co.uk> | 2019-05-29 21:44:25 +0100 |
commit | 0bfc35c88e75a7eb47c38f7a31b6cf7f84130ea5 (patch) | |
tree | 4140260f710d0c9b54fe1913409c7f23df11a6ef /blabouncer.c | |
parent | 94afbd330fc6c35f12326216ee21c5e87830eb8d (diff) |
Read debug setting from configuration file immediately before doing debug file rotation to avoid writing to previous debug file.
Diffstat (limited to 'blabouncer.c')
-rw-r--r-- | blabouncer.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/blabouncer.c b/blabouncer.c index 851df7a..e0c9b21 100644 --- a/blabouncer.c +++ b/blabouncer.c @@ -2558,13 +2558,6 @@ int main(int argc, char *argv[]) { } } - // Is debugging enabled? - debug = getconfint("debug", settings.conffile); - if (!snprintf(debugpath, PATH_MAX, "%s/debug.txt", settings.basedir)) { - fprintf(stderr, "Error while preparing debug path location!\n"); - exit(1); - } - // Make sure the base directory exists struct stat st = {0}; if (stat(settings.basedir, &st) == -1) { @@ -2582,6 +2575,13 @@ int main(int argc, char *argv[]) { // Is replay logging enabled? settings.replaylogging = getconfint("replaylogging", settings.conffile); + // Is debugging enabled? + debug = getconfint("debug", settings.conffile); + if (!snprintf(debugpath, PATH_MAX, "%s/debug.txt", settings.basedir)) { + fprintf(stderr, "Error while preparing debug path location!\n"); + exit(1); + } + // Prepare the debug file // (Keep DEBUGFILESKEEP number of debug files around for past debugging) if (DEBUGFILESKEEP > 0) { |