* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: dighost.c,v 1.174.2.6 2001/02/25 01:31:03 gson Exp $ */
+/* $Id: dighost.c,v 1.174.2.7 2001/03/14 01:25:37 bwelling Exp $ */
/*
* Notice to programmers: Do not use this code as an example of how to
usesearch = ISC_FALSE,
qr = ISC_FALSE,
is_dst_up = ISC_FALSE,
- have_domain = ISC_FALSE,
- is_blocking = ISC_FALSE;
+ have_domain = ISC_FALSE;
in_port_t port = 53;
unsigned int timeout = 0;
else
hints.ai_family = PF_UNSPEC;
debug ("before getaddrinfo()");
- is_blocking = ISC_TRUE;
+ isc_app_block();
result = getaddrinfo(host, NULL, &hints, &res);
- is_blocking = ISC_FALSE;
+ isc_app_unblock();
if (result != 0) {
fatal("Couldn't find server '%s': %s",
host, gai_strerror(result));
freeaddrinfo(res);
#else
debug ("before gethostbyname()");
- is_blocking = ISC_TRUE;
+ isc_app_block();
he = gethostbyname(host);
- is_blocking = ISC_FALSE;
+ isc_app_unblock();
if (he == NULL)
fatal("Couldn't find server '%s' (h_errno=%d)",
host, h_errno);
debug("cancel_all()");
- if (is_blocking) {
- /*
- * If we get here while another thread is blocking, there's
- * really nothing we can do to make a clean shutdown
- * without waiting for the block to complete. The only
- * way to get the system down now is to just exit out,
- * and trust the OS to clean up for us.
- */
- fputs("Abort.\n", stderr);
- exit(1);
- }
LOCK_LOOKUP;
if (free_now) {
UNLOCK_LOOKUP;
dig_searchlist_t *o;
debug("destroy_libs()");
- if (is_blocking) {
- /*
- * If we get here while another thread is blocking, there's
- * really nothing we can do to make a clean shutdown
- * without waiting for the block to complete. The only
- * way to get the system down now is to just exit out,
- * and trust the OS to clean up for us.
- */
- fputs("Abort.\n", stderr);
- exit(1);
- }
if (global_task != NULL) {
debug("freeing task");
isc_task_detach(&global_task);
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: nslookup.c,v 1.69.2.3 2001/01/17 19:37:37 gson Exp $ */
+/* $Id: nslookup.c,v 1.69.2.4 2001/03/14 01:25:38 bwelling Exp $ */
#include <config.h>
extern ISC_LIST(dig_searchlist_t) search_list;
extern isc_boolean_t have_ipv6,
- usesearch, trace, qr, debugging, is_blocking;
+ usesearch, trace, qr, debugging;
extern in_port_t port;
extern unsigned int timeout;
extern isc_mem_t *mctx;
if (buf == NULL)
fatal("Memory allocation failure.");
fputs("> ", stderr);
- is_blocking = ISC_TRUE;
+ isc_app_block();
ptr = fgets(buf, COMMSIZE, stdin);
- is_blocking = ISC_FALSE;
+ isc_app_unblock();
if (ptr == NULL) {
in_use = ISC_FALSE;
goto cleanup;
debug("done, and starting to shut down");
if (global_event != NULL)
isc_event_free(&global_event);
+ cancel_all();
destroy_libs();
isc_app_finish();