2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-09-02 15:45:25 +00:00

Move taskmgr shutdown to the correct place.

This commit is contained in:
Michael Sawyer
2000-06-30 14:11:49 +00:00
parent 85dd6d777a
commit 1893b56ef9
4 changed files with 25 additions and 10 deletions

View File

@@ -15,7 +15,7 @@
* SOFTWARE. * SOFTWARE.
*/ */
/* $Id: dig.c,v 1.53 2000/06/29 05:21:08 mws Exp $ */ /* $Id: dig.c,v 1.54 2000/06/30 14:11:45 mws Exp $ */
#include <config.h> #include <config.h>
#include <stdlib.h> #include <stdlib.h>
@@ -25,6 +25,7 @@ extern int h_errno;
#include <isc/app.h> #include <isc/app.h>
#include <isc/string.h> #include <isc/string.h>
#include <isc/util.h> #include <isc/util.h>
#include <isc/task.h>
#include <dns/message.h> #include <dns/message.h>
#include <dns/name.h> #include <dns/name.h>
@@ -63,6 +64,7 @@ extern char keynametext[MXNAME];
extern char keysecret[MXNAME]; extern char keysecret[MXNAME];
extern dns_tsigkey_t *key; extern dns_tsigkey_t *key;
extern isc_boolean_t validated; extern isc_boolean_t validated;
extern isc_taskmgr_t *taskmgr;
extern isc_boolean_t debugging; extern isc_boolean_t debugging;
extern isc_boolean_t isc_mem_debugging; extern isc_boolean_t isc_mem_debugging;
@@ -992,7 +994,7 @@ parse_args(isc_boolean_t is_batchfile, int argc, char **argv) {
show_usage(); show_usage();
exit (exitcode); exit (exitcode);
} else if (strcmp(rv[0], "-memdebug") == 0) { } else if (strcmp(rv[0], "-memdebug") == 0) {
isc_mem_debugging = ISC_TRUE; isc_mem_debugging = 1;
} else if (strcmp(rv[0], "-debug") == 0) { } else if (strcmp(rv[0], "-debug") == 0) {
debugging = ISC_TRUE; debugging = ISC_TRUE;
} else if (strncmp(rv[0], "-x", 2) == 0) { } else if (strncmp(rv[0], "-x", 2) == 0) {
@@ -1221,9 +1223,13 @@ main(int argc, char **argv) {
setup_system(); setup_system();
start_lookup(); start_lookup();
isc_app_run(); isc_app_run();
isc_app_finish();
if (taskmgr != NULL) {
debug ("Freeing taskmgr");
isc_taskmgr_destroy(&taskmgr);
}
if (isc_mem_debugging) if (isc_mem_debugging)
isc_mem_stats(mctx, stderr); isc_mem_stats(mctx, stderr);
isc_app_finish();
if (mctx != NULL) if (mctx != NULL)
isc_mem_destroy(&mctx); isc_mem_destroy(&mctx);
return (exitcode); return (exitcode);

View File

@@ -15,7 +15,7 @@
* SOFTWARE. * SOFTWARE.
*/ */
/* $Id: dighost.c,v 1.63 2000/06/29 07:43:46 explorer Exp $ */ /* $Id: dighost.c,v 1.64 2000/06/30 14:11:46 mws Exp $ */
/* /*
* Notice to programmers: Do not use this code as an example of how to * Notice to programmers: Do not use this code as an example of how to
@@ -2021,6 +2021,7 @@ free_lists(int _exitcode) {
debug ("Freeing global server %p", s); debug ("Freeing global server %p", s);
ptr = s; ptr = s;
s = ISC_LIST_NEXT(s, link); s = ISC_LIST_NEXT(s, link);
debug ("ptr is now %p", ptr);
isc_mem_free(mctx, ptr); isc_mem_free(mctx, ptr);
} }
o = ISC_LIST_HEAD(search_list); o = ISC_LIST_HEAD(search_list);
@@ -2042,10 +2043,6 @@ free_lists(int _exitcode) {
debug ("Freeing task"); debug ("Freeing task");
isc_task_detach(&global_task); isc_task_detach(&global_task);
} }
if (taskmgr != NULL) {
debug ("Freeing taskmgr");
isc_taskmgr_destroy(&taskmgr);
}
if (key != NULL) { if (key != NULL) {
debug ("Freeing key %p", key); debug ("Freeing key %p", key);
dns_tsigkey_setdeleted(key); dns_tsigkey_setdeleted(key);

View File

@@ -15,7 +15,7 @@
* SOFTWARE. * SOFTWARE.
*/ */
/* $Id: host.c,v 1.31 2000/06/29 05:21:11 mws Exp $ */ /* $Id: host.c,v 1.32 2000/06/30 14:11:48 mws Exp $ */
#include <config.h> #include <config.h>
#include <stdlib.h> #include <stdlib.h>
@@ -30,6 +30,7 @@ extern int h_errno;
#include <isc/commandline.h> #include <isc/commandline.h>
#include <isc/string.h> #include <isc/string.h>
#include <isc/util.h> #include <isc/util.h>
#include <isc/task.h>
#include <dig/dig.h> #include <dig/dig.h>
@@ -50,6 +51,7 @@ extern int ndots;
extern int tries; extern int tries;
extern int lookup_counter; extern int lookup_counter;
extern int exitcode; extern int exitcode;
extern isc_taskmgr_t *taskmgr;
isc_boolean_t short_form = ISC_TRUE, isc_boolean_t short_form = ISC_TRUE,
filter = ISC_FALSE, filter = ISC_FALSE,
@@ -696,6 +698,10 @@ main(int argc, char **argv) {
setup_system(); setup_system();
start_lookup(); start_lookup();
isc_app_run(); isc_app_run();
if (taskmgr != NULL) {
debug ("Freeing taskmgr");
isc_taskmgr_destroy(&taskmgr);
}
if (isc_mem_debugging) if (isc_mem_debugging)
isc_mem_stats(mctx, stderr); isc_mem_stats(mctx, stderr);
isc_app_finish(); isc_app_finish();

View File

@@ -15,7 +15,7 @@
* SOFTWARE. * SOFTWARE.
*/ */
/* $Id: nslookup.c,v 1.21 2000/06/29 05:21:12 mws Exp $ */ /* $Id: nslookup.c,v 1.22 2000/06/30 14:11:49 mws Exp $ */
#include <config.h> #include <config.h>
@@ -36,6 +36,7 @@ extern int h_errno;
#include <isc/string.h> #include <isc/string.h>
#include <isc/timer.h> #include <isc/timer.h>
#include <isc/util.h> #include <isc/util.h>
#include <isc/task.h>
#include <dig/dig.h> #include <dig/dig.h>
@@ -57,6 +58,7 @@ extern int tries;
extern int lookup_counter; extern int lookup_counter;
extern char fixeddomain[MXNAME]; extern char fixeddomain[MXNAME];
extern int exitcode; extern int exitcode;
extern isc_taskmgr_t *taskmgr;
isc_boolean_t short_form = ISC_TRUE, printcmd = ISC_TRUE, isc_boolean_t short_form = ISC_TRUE, printcmd = ISC_TRUE,
filter = ISC_FALSE, showallsoa = ISC_FALSE, filter = ISC_FALSE, showallsoa = ISC_FALSE,
@@ -875,6 +877,10 @@ main(int argc, char **argv) {
free_lists(0); free_lists(0);
isc_mutex_destroy(&lock); isc_mutex_destroy(&lock);
isc_condition_destroy(&cond); isc_condition_destroy(&cond);
if (taskmgr != NULL) {
debug ("Freeing taskmgr");
isc_taskmgr_destroy(&taskmgr);
}
if (isc_mem_debugging) if (isc_mem_debugging)
isc_mem_stats(mctx, stderr); isc_mem_stats(mctx, stderr);
isc_app_finish(); isc_app_finish();