]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Fix #52 #53, fix for example fail program.
authorW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Thu, 1 Aug 2019 07:34:44 +0000 (09:34 +0200)
committerW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Thu, 1 Aug 2019 07:34:44 +0000 (09:34 +0200)
doc/Changelog
libunbound/context.c
libunbound/libunbound.c

index 50175902ee837c05088aceae7c11b18c2fc8588c..7042734d8a74b1c115a1995ea05f15922a5e77f3 100644 (file)
@@ -1,5 +1,6 @@
 1 August 2019: Wouter
        - For #52 #53, second context does not close logfile override.
+       - Fix #52 #53, fix for example fail program.
 
 29 July 2019: Wouter
        - Add verbose log message when auth zone file is written, at level 4.
index 6d8b7b7b5da922be66de1b20b4d53e9bf91e7877..b8fe87d2e580d822706335be231d86ef4d976450 100644 (file)
@@ -57,7 +57,7 @@ context_finalize(struct ub_ctx* ctx)
 {
        struct config_file* cfg = ctx->env->cfg;
        verbosity = cfg->verbosity;
-       if(ctx_logfile_overridden) {
+       if(ctx_logfile_overridden && !ctx->logfile_override) {
                log_file(NULL); /* clear that override */
                ctx_logfile_overridden = 0;
        }
index b5f1137b8180e1d5dc2fcdbb26c7db6deb94bc83..263dde5a4604f636ffdee8cdfec0486e19ffb592 100644 (file)
@@ -93,7 +93,8 @@ static struct ub_ctx* ub_ctx_create_nopipe(void)
 #endif
        
        checklock_start();
-       log_init(NULL, 0, NULL); /* logs to stderr */
+       if(!ctx_logfile_overridden)
+               log_init(NULL, 0, NULL); /* logs to stderr */
        log_ident_set("libunbound");
 #ifdef USE_WINSOCK
        if((r = WSAStartup(MAKEWORD(2,2), &wsa_data)) != 0) {
@@ -476,6 +477,7 @@ int ub_ctx_debugout(struct ub_ctx* ctx, void* out)
 {
        lock_basic_lock(&ctx->cfglock);
        log_file((FILE*)out);
+       ctx_logfile_overridden = 1;
        ctx->logfile_override = 1;
        ctx->log_out = out;
        lock_basic_unlock(&ctx->cfglock);