mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-10 03:16:17 +01:00
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:
parent
ed7c3dd343
commit
c2b5fe9f2d
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user