evdns_add_server_port_with_base(event_base, sock, 0, evdns_server_callback, NULL);
}
if (idx < c) {
-#ifdef WIN32
+ int res;
- evdns_base_config_windows_nameservers(evdns_base);
+#ifdef _WIN32
+ res = evdns_base_config_windows_nameservers(evdns_base);
#else
- evdns_base_resolv_conf_parse(evdns_base, DNS_OPTION_NAMESERVERS,
+ res = evdns_base_resolv_conf_parse(evdns_base, DNS_OPTION_NAMESERVERS,
"/etc/resolv.conf");
#endif
+ if (res < 0) {
+ fprintf(stderr, "Couldn't configure nameservers");
+ return 1;
+ }
}
printf("EVUTIL_AI_CANONNAME in example = %d\n", EVUTIL_AI_CANONNAME);