diff --git a/lib/roken/resolve.c b/lib/roken/resolve.c index 3590e6700..d35beac5b 100644 --- a/lib/roken/resolve.c +++ b/lib/roken/resolve.c @@ -40,6 +40,12 @@ #include #endif #include "roken.h" +#ifdef HAVE_ARPA_NAMESER_H +#include +#endif +#ifdef HAVE_RESOLV_H +#include +#endif #include "resolve.h" RCSID("$Id$"); @@ -63,6 +69,8 @@ static struct stot{ {NULL, 0} }; +int _resolve_debug; + static int string_to_type(const char *name) { @@ -255,20 +263,16 @@ dns_lookup(const char *domain, const char *type_name) u_long old_options = 0; type = string_to_type(type_name); -#if 0 - if (krb_dns_debug) { + if (_resolve_debug) { old_options = _res.options; _res.options |= RES_DEBUG; - krb_warning("dns_lookup(%s, %s)\n", domain, type_name); + fprintf(stderr, "dns_lookup(%s, %s)\n", domain, type_name); } -#endif len = res_search(domain, C_IN, type, reply, sizeof(reply)); -#if 0 - if (krb_dns_debug) { + if (_resolve_debug) { _res.options = old_options; - krb_warning("dns_lookup(%s, %s) --> %d\n", domain, type_name, len); + fprintf(stderr, "dns_lookup(%s, %s) --> %d\n", domain, type_name, len); } -#endif if (len >= 0) r = parse_reply(reply, len); return r;