Re-run res_init() when resolv.conf changes

libc caches the contents of resolv.conf, so if it changes (eg, because
the network state changed), we need re-run res_init().

http://bugzilla.gnome.org/show_bug.cgi?id=584246
This commit is contained in:
Dan Winship
2009-08-19 12:07:53 -04:00
parent 6db03d73a4
commit 021dd960cf
5 changed files with 132 additions and 24 deletions

View File

@@ -36,15 +36,22 @@ G_BEGIN_DECLS
#define G_IS_RESOLVER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_RESOLVER))
#define G_RESOLVER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_RESOLVER, GResolverClass))
typedef struct _GResolverPrivate GResolverPrivate;
typedef struct _GResolverClass GResolverClass;
struct _GResolver {
GObject parent_instance;
GResolverPrivate *priv;
};
typedef struct _GResolverClass GResolverClass;
struct _GResolverClass {
GObjectClass parent_class;
/* Signals */
void ( *reload) (GResolver *resolver);
/* Virtual methods */
GList * ( *lookup_by_name) (GResolver *resolver,
const gchar *hostname,
GCancellable *cancellable,