0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-06-02 01:59:33 +02:00

ircd::net::dns: Call setprotoent(3) on init to throw here on missing libnss_db.so.

This commit is contained in:
Jason Volk 2020-03-08 15:05:21 -07:00
parent dcc0aae886
commit 133b3a5611

View file

@ -35,6 +35,11 @@ ircd::net::dns::opts_default;
ircd::net::dns::init::init()
{
#ifdef HAVE_NETDB_H
static const int stay_open {true};
::setprotoent(stay_open);
#endif
assert(!resolver_instance);
resolver_instance = new resolver
{
@ -47,6 +52,10 @@ noexcept
{
delete resolver_instance;
resolver_instance = nullptr;
#ifdef HAVE_NETDB_H
::endprotoent();
#endif
}
//