]> granicus.if.org Git - libevent/commitdiff
Merge remote-tracking branch 'origin/patches-2.0'
authorNick Mathewson <nickm@torproject.org>
Mon, 14 Nov 2011 16:45:17 +0000 (11:45 -0500)
committerNick Mathewson <nickm@torproject.org>
Mon, 14 Nov 2011 16:45:17 +0000 (11:45 -0500)
Conflicts:
sample/dns-example.c

1  2 
sample/dns-example.c

index d8134e8311b6ffbe81be156904cdc0e39bd8125a,f97a0c6bab31833a5240afe093c5a1229ba52d24..6ba1359ad695db12eae384a2600196beb04f1977
@@@ -188,12 -195,17 +195,17 @@@ main(int c, char **v) 
                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);