gresolver: remove unneeded call to res_init()

This call was needed once upon a time, when GResolver had subclasses
that presumably relied on this. Nowadays, we have only
GThreadedResolver, which does not need it. res_init() is dangerous
because it modifies global state, so let's get rid of it.
This commit is contained in:
Michael Catanzaro 2021-11-22 14:43:15 -06:00
parent ed7c3dd343
commit c2b5fe9f2d
2 changed files with 0 additions and 19 deletions

View File

@ -242,11 +242,6 @@ g_resolver_set_default (GResolver *resolver)
G_UNLOCK (default_resolver);
}
/* Bionic has res_init() but it's not in any header */
#ifdef __BIONIC__
int res_init (void);
#endif
static void
g_resolver_maybe_reload (GResolver *resolver)
{
@ -258,9 +253,6 @@ g_resolver_maybe_reload (GResolver *resolver)
if (st.st_mtime != resolver->priv->resolv_conf_timestamp)
{
resolver->priv->resolv_conf_timestamp = st.st_mtime;
#ifdef HAVE_RES_INIT
res_init ();
#endif
g_signal_emit (resolver, signals[RELOAD], 0);
}
}

View File

@ -74,17 +74,6 @@ if host_system != 'windows'
endif
endif
# res_init()
if cc.links('''#include <sys/types.h>
#include <netinet/in.h>
#include <arpa/nameser.h>
#include <resolv.h>
int main (int argc, char ** argv) {
return res_init();
}''', args : network_args, name : 'res_init()')
glib_conf.set('HAVE_RES_INIT', 1)
endif
# res_nclose()
if cc.links('''#include <sys/types.h>
#include <netinet/in.h>