* 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>
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)
* 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>
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);
* 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>
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);
* 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>
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)
* 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>
*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;
* 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
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);