]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
logging changes.
authorBrian Wellington <source@isc.org>
Tue, 26 Sep 2000 22:11:25 +0000 (22:11 +0000)
committerBrian Wellington <source@isc.org>
Tue, 26 Sep 2000 22:11:25 +0000 (22:11 +0000)
bin/dnssec/dnssec-keygen.c
bin/dnssec/dnssec-makekeyset.c
bin/dnssec/dnssec-signkey.c
bin/dnssec/dnssec-signzone.c
bin/dnssec/dnssectool.c
bin/dnssec/dnssectool.h

index dcf05dd1204ea771199965309eb1c46dbecf74b4..2de8ce1b47f7cc9b5d0708dfe987d68d20f26c01 100644 (file)
@@ -17,7 +17,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: dnssec-keygen.c,v 1.41 2000/09/21 17:18:14 bwelling Exp $ */
+/* $Id: dnssec-keygen.c,v 1.42 2000/09/26 22:11:20 bwelling Exp $ */
 
 #include <config.h>
 
@@ -390,8 +390,7 @@ main(int argc, char **argv) {
        isc_mem_free(mctx, prog);
        dst_key_free(&key);
 
-       if (log != NULL)
-               isc_log_destroy(&log);
+       cleanup_logging(&log);
        cleanup_entropy(&ectx);
        dst_lib_destroy();
        if (verbose > 10)
index 9236a65d33859a2d0cc9304c442efe4dc526af42..9835838f3687118b699fd981273348458c742509 100644 (file)
@@ -17,7 +17,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: dnssec-makekeyset.c,v 1.40 2000/09/12 11:50:45 bwelling Exp $ */
+/* $Id: dnssec-makekeyset.c,v 1.41 2000/09/26 22:11:21 bwelling Exp $ */
 
 #include <config.h>
 
@@ -396,8 +396,7 @@ main(int argc, char *argv[]) {
                isc_mem_put(mctx, savedname, sizeof(dns_name_t));
        }
 
-       if (log != NULL)
-               isc_log_destroy(&log);
+       cleanup_logging(&log);
        cleanup_entropy(&ectx);
 
        isc_mem_free(mctx, output);
index 75dc7deef3883de8aed009bcf57881d4d88c5e02..2d3f1082253256df4c4ab2f954f9659c3e918ca5 100644 (file)
@@ -17,7 +17,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: dnssec-signkey.c,v 1.36 2000/09/12 11:50:46 bwelling Exp $ */
+/* $Id: dnssec-signkey.c,v 1.37 2000/09/26 22:11:22 bwelling Exp $ */
 
 #include <config.h>
 
@@ -420,8 +420,7 @@ main(int argc, char *argv[]) {
                isc_mem_put(mctx, keynode, sizeof(keynode_t));
        }
 
-       if (log != NULL)
-               isc_log_destroy(&log);
+       cleanup_logging(&log);
 
         isc_mem_free(mctx, output);
        cleanup_entropy(&ectx);
index afcc18cf9683260bc83385a3f1c83028a0852583..8bdbdadd6b53313e33e48c342aa3d478c5ab3c1c 100644 (file)
@@ -17,7 +17,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: dnssec-signzone.c,v 1.99 2000/09/12 11:33:14 bwelling Exp $ */
+/* $Id: dnssec-signzone.c,v 1.100 2000/09/26 22:11:23 bwelling Exp $ */
 
 #include <config.h>
 
@@ -1447,8 +1447,7 @@ main(int argc, char *argv[]) {
        if (free_output)
                isc_mem_free(mctx, output);
 
-       if (log != NULL)
-               isc_log_destroy(&log);
+       cleanup_logging(&log);
        dst_lib_destroy();
        cleanup_entropy(&ectx);
        if (verbose > 10)
index fd120b7654e3118cebe0489d4b400b8ac2b2a8e2..ffe011f9b0b59206b5e26746322b16f7b023019f 100644 (file)
@@ -15,7 +15,7 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: dnssectool.c,v 1.21 2000/09/08 08:38:58 bwelling Exp $ */
+/* $Id: dnssectool.c,v 1.22 2000/09/26 22:11:24 bwelling Exp $ */
 
 #include <config.h>
 
@@ -178,6 +178,21 @@ setup_logging(int verbose, isc_mem_t *mctx, isc_log_t **logp) {
        *logp = log;
 }
 
+void
+cleanup_logging(isc_log_t **logp) {
+       isc_log_t *log;
+
+       REQUIRE(logp != NULL);
+
+       log = *logp;
+       if (log == NULL)
+               return;
+       isc_log_destroy(&log);
+       isc_log_setcontext(NULL);
+       dns_log_setcontext(NULL);
+       logp = NULL;
+}
+
 static isc_result_t
 kbdstart(isc_entropysource_t *source, void *arg, isc_boolean_t blocking) {
        isc_keyboard_t *kbd = (isc_keyboard_t *)arg;
index 78d0f0c5f54cdf0953aa4616eb391ca53c31614b..d4f4797bddea6122743f9da297fad7c55bc49ef0 100644 (file)
@@ -15,7 +15,7 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: dnssectool.h,v 1.11 2000/09/08 08:38:59 bwelling Exp $ */
+/* $Id: dnssectool.h,v 1.12 2000/09/26 22:11:25 bwelling Exp $ */
 
 #ifndef DNSSECTOOL_H
 #define DNSSECTOOL_H 1
@@ -53,6 +53,9 @@ key_format(const dst_key_t *key, char *cp, unsigned int size);
 void
 setup_logging(int verbose, isc_mem_t *mctx, isc_log_t **logp);
 
+void
+cleanup_logging(isc_log_t **logp);
+
 void
 setup_entropy(isc_mem_t *mctx, const char *randomfile, isc_entropy_t **ectx);