aboutsummaryrefslogtreecommitdiff
path: root/ares/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
commit2d64cd55a1069ff7fc7e6d8caf5c67353f1ec55f (patch)
tree62f21bf8bc7dc95ca6aab563340065feac445b6b /ares/acountry.c
parent60a6af74983d45503067b7e53b14117076a05115 (diff)
Introduction of ares_library_init() and ares_library_cleanup()
Diffstat (limited to 'ares/acountry.c')
-rw-r--r--ares/acountry.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/ares/acountry.c b/ares/acountry.c
index cac9ae5b0..1899ae962 100644
--- a/ares/acountry.c
+++ b/ares/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