Commit db503b6d authored by Brian Wellington's avatar Brian Wellington
Browse files

logging changes.

parent df03463a
......@@ -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)
......
......@@ -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);
......
......@@ -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);
......
......@@ -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)
......
......@@ -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;
......
......@@ -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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment