summaryrefslogtreecommitdiff
path: root/acountry.c
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2009-05-17 17:11:28 +0000
committerYang Tse <yangsita@gmail.com>2009-05-17 17:11:28 +0000
commitb7c7bab713e3bfba6626050806c4f4584207be6d (patch)
tree187cb4e2b9cc48c6588a38cfb3b8a6974f994920 /acountry.c
parentc03c7251c9822de3989513a7b927550f6d7bb757 (diff)
downloadc-ares-b7c7bab713e3bfba6626050806c4f4584207be6d.tar.gz
c-ares-b7c7bab713e3bfba6626050806c4f4584207be6d.tar.bz2
c-ares-b7c7bab713e3bfba6626050806c4f4584207be6d.zip
Introduction of ares_library_init() and ares_library_cleanup()
Diffstat (limited to 'acountry.c')
-rw-r--r--acountry.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/acountry.c b/acountry.c
index cac9ae5..1899ae9 100644
--- a/acountry.c
+++ b/acountry.c
@@ -116,6 +116,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;
+ }
+
while ((ch = ares_getopt(argc, argv, "dvh?")) != -1)
switch (ch)
{
@@ -178,6 +185,8 @@ int main(int argc, char **argv)
wait_ares(channel);
ares_destroy(channel);
+ ares_library_cleanup();
+
#if defined(WIN32) && !defined(WATT32)
WSACleanup();
#endif