summaryrefslogtreecommitdiff
path: root/src/libs6dns/s6dns_init.c
blob: 10dcbf5afc2a73b01774a6116194c1159ea97825 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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 ;
}