summaryrefslogtreecommitdiff
path: root/adig.c
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2009-05-17 17:11:28 (GMT)
committerYang Tse <yangsita@gmail.com>2009-05-17 17:11:28 (GMT)
commitb7c7bab713e3bfba6626050806c4f4584207be6d (patch)
tree187cb4e2b9cc48c6588a38cfb3b8a6974f994920 /adig.c
parentc03c7251c9822de3989513a7b927550f6d7bb757 (diff)
downloadc-ares-b7c7bab713e3bfba6626050806c4f4584207be6d.zip
c-ares-b7c7bab713e3bfba6626050806c4f4584207be6d.tar.gz
c-ares-b7c7bab713e3bfba6626050806c4f4584207be6d.tar.bz2
Introduction of ares_library_init() and ares_library_cleanup()
Diffstat (limited to 'adig.c')
-rw-r--r--adig.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/adig.c b/adig.c
index 7df32d9..8b5cb2a 100644
--- a/adig.c
+++ b/adig.c
@@ -187,6 +187,13 @@ int main(int argc, char **argv)
WSAStartup(wVersionRequested, &wsaData);
#endif
+ status = ares_library_init(ARES_LIB_INIT_ALL);
+ if (status != ARES_SUCCESS)
+ {
+ fprintf(stderr, "ares_library_init: %s\n", ares_strerror(status));
+ return 1;
+ }
+
options.flags = ARES_FLAG_NOCHECKRESP;
options.servers = NULL;
options.nservers = 0;
@@ -325,6 +332,8 @@ int main(int argc, char **argv)
ares_destroy(channel);
+ ares_library_cleanup();
+
#ifdef USE_WINSOCK
WSACleanup();
#endif