summary refs log tree commit diff
diff options
context:
space:
mode:
authorRichard Nyberg <rnyberg@murmeldjur.se>2006-10-31 19:34:25 +0000
committerRichard Nyberg <rnyberg@murmeldjur.se>2006-10-31 19:34:25 +0000
commitabe4001938d637808bd5cca29124a02edff8c51c (patch)
treeb8eac6e3fdaf5e3e85b3ed17701e24023099110d
parentfb64d693f13842a6220f4badec9b93b3b2e13d88 (diff)
downloadbtpd-abe4001938d637808bd5cca29124a02edff8c51c.tar.gz
btpd-abe4001938d637808bd5cca29124a02edff8c51c.zip
Add initialization of evdns.
-rw-r--r--btpd/main.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/btpd/main.c b/btpd/main.c
index cabe0d2..5eb40fd 100644
--- a/btpd/main.c
+++ b/btpd/main.c
@@ -2,13 +2,13 @@
 #include <sys/file.h>
 #include <sys/stat.h>
 
-#include <assert.h>
 #include <err.h>
 #include <errno.h>
+#include <event.h>
+#include <evdns.h>
 #include <fcntl.h>
 #include <getopt.h>
 #include <stdio.h>
-#include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
 
@@ -216,6 +216,12 @@ args_done:
 
     event_init();
 
+    if ((errno = evdns_resolv_conf_parse(DNS_OPTION_NAMESERVERS,
+             "/etc/resolv.conf")) != 0) {
+        btpd_log(BTPD_L_ERROR,
+            "failed to setup dns from /etc/resolv.conf (%d).\n", errno);
+    }
+
     btpd_init();
 
     event_dispatch();