summaryrefslogtreecommitdiff
path: root/src/libs6dns/s6dns_init.c
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2023-07-12 16:53:59 +0000
committerLaurent Bercot <ska@appnovation.com>2023-07-12 16:53:59 +0000
commit207845f50a8fb54fe8e584928078dc3687399caf (patch)
treef58eac67edc2dbaba13a48442a2093f76e869991 /src/libs6dns/s6dns_init.c
parent8cf671e973a4ea2ef7c9ca1321531a7ceeaa5073 (diff)
downloads6-dns-207845f50a8fb54fe8e584928078dc3687399caf.tar.xz
Pass on all clients, add hosts support wherever applicable
Signed-off-by: Laurent Bercot <ska@appnovation.com>
Diffstat (limited to 'src/libs6dns/s6dns_init.c')
-rw-r--r--src/libs6dns/s6dns_init.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/libs6dns/s6dns_init.c b/src/libs6dns/s6dns_init.c
index 7f98d13..10dcbf5 100644
--- a/src/libs6dns/s6dns_init.c
+++ b/src/libs6dns/s6dns_init.c
@@ -1,10 +1,16 @@
/* ISC license. */
#include <s6-dns/s6dns-rci.h>
+#include <s6-dns/hosts.h>
#include <s6-dns/s6dns.h>
int s6dns_init (void)
{
if (!s6dns_rci_init(&s6dns_rci_here, "/etc/resolv.conf")) return 0 ;
+ if (s6dns_hosts_init(&s6dns_hosts_here, "/etc/hosts", "/etc/hosts.cdb", "/tmp/hosts.cdb") == -1) goto err ;
return 1 ;
+
+ err:
+ s6dns_rci_free(&s6dns_rci_here) ;
+ return 0 ;
}