Commit 74a2c640 authored by Thomas Haller's avatar Thomas Haller

core: merge branch 'th/singleton-bgo742450'

https://bugzilla.gnome.org/show_bug.cgi?id=742450
parents 2a3d65f8 1208c0dd
......@@ -100,4 +100,64 @@
_found; \
})
/*****************************************************************************/
#define NM_DEFINE_SINGLETON_INSTANCE(TYPE) \
static TYPE *singleton_instance
#define NM_DEFINE_SINGLETON_WEAK_REF(TYPE) \
NM_DEFINE_SINGLETON_INSTANCE (TYPE); \
static void \
_singleton_instance_weak_ref_cb (gpointer data, \
GObject *where_the_object_was) \
{ \
nm_log_dbg (LOGD_CORE, "disposing %s singleton (%p)", G_STRINGIFY (TYPE), singleton_instance); \
singleton_instance = NULL; \
} \
static inline void \
nm_singleton_instance_weak_ref_register (void) \
{ \
g_object_weak_ref (G_OBJECT (singleton_instance), _singleton_instance_weak_ref_cb, NULL); \
}
#define NM_DEFINE_SINGLETON_DESTRUCTOR(TYPE) \
NM_DEFINE_SINGLETON_INSTANCE (TYPE); \
static void __attribute__((destructor)) \
_singleton_destructor (void) \
{ \
if (singleton_instance) { \
if (G_OBJECT (singleton_instance)->ref_count > 1) \
nm_log_dbg (LOGD_CORE, "disown %s singleton (%p)", G_STRINGIFY (TYPE), singleton_instance); \
g_object_unref (singleton_instance); \
} \
}
/* By default, the getter will assert that the singleton will be created only once. You can
* change this by redefining NM_DEFINE_SINGLETON_ALLOW_MULTIPLE. */
#ifndef NM_DEFINE_SINGLETON_ALLOW_MULTIPLE
#define NM_DEFINE_SINGLETON_ALLOW_MULTIPLE FALSE
#endif
#define NM_DEFINE_SINGLETON_GETTER(TYPE, GETTER, GTYPE, ...) \
NM_DEFINE_SINGLETON_INSTANCE (TYPE); \
NM_DEFINE_SINGLETON_WEAK_REF (TYPE); \
TYPE * \
GETTER (void) \
{ \
if (G_UNLIKELY (!singleton_instance)) { \
static char _already_created = FALSE; \
\
g_assert (!_already_created || (NM_DEFINE_SINGLETON_ALLOW_MULTIPLE)); \
_already_created = TRUE;\
singleton_instance = (g_object_new (GTYPE, ##__VA_ARGS__, NULL)); \
g_assert (singleton_instance); \
nm_singleton_instance_weak_ref_register (); \
nm_log_dbg (LOGD_CORE, "create %s singleton (%p)", G_STRINGIFY (TYPE), singleton_instance); \
} \
return singleton_instance; \
} \
NM_DEFINE_SINGLETON_DESTRUCTOR(TYPE)
/*****************************************************************************/
#endif
......@@ -946,7 +946,7 @@ nm_8021x_stage2_config (NMDeviceEthernet *self, NMDeviceStateReason *reason)
}
if (!priv->supplicant.mgr)
priv->supplicant.mgr = nm_supplicant_manager_get ();
priv->supplicant.mgr = g_object_ref (nm_supplicant_manager_get ());
/* If we need secrets, get them */
setting_name = nm_connection_need_secrets (connection, NULL);
......
......@@ -224,8 +224,7 @@ constructor (GType type,
_LOGI (LOGD_HW | LOGD_WIFI, "driver supports Access Point (AP) mode");
/* Connect to the supplicant manager */
priv->sup_mgr = nm_supplicant_manager_get ();
g_assert (priv->sup_mgr);
priv->sup_mgr = g_object_ref (nm_supplicant_manager_get ());
return object;
}
......
......@@ -193,16 +193,7 @@ dis_connection_cb (NMDBusManager *mgr,
/***************************************************/
NMDhcpListener *
nm_dhcp_listener_get (void)
{
static NMDhcpListener *singleton = NULL;
if (G_UNLIKELY (singleton == NULL))
singleton = g_object_new (NM_TYPE_DHCP_LISTENER, NULL);
g_assert (singleton);
return singleton;
}
NM_DEFINE_SINGLETON_GETTER (NMDhcpListener, nm_dhcp_listener_get, NM_TYPE_DHCP_LISTENER);
static void
nm_dhcp_listener_init (NMDhcpListener *self)
......
......@@ -371,16 +371,7 @@ nm_dhcp_manager_get_lease_ip_configs (NMDhcpManager *self,
/***************************************************/
NMDhcpManager *
nm_dhcp_manager_get (void)
{
static NMDhcpManager *singleton = NULL;
if (G_UNLIKELY (singleton == NULL))
singleton = g_object_new (NM_TYPE_DHCP_MANAGER, NULL);
g_assert (singleton);
return singleton;
}
NM_DEFINE_SINGLETON_GETTER (NMDhcpManager, nm_dhcp_manager_get, NM_TYPE_DHCP_MANAGER);
static void
nm_dhcp_manager_init (NMDhcpManager *self)
......
......@@ -1080,18 +1080,7 @@ nm_dns_manager_end_updates (NMDnsManager *mgr, const char *func)
/******************************************************************/
NMDnsManager *
nm_dns_manager_get (void)
{
static NMDnsManager * singleton = NULL;
if (!singleton) {
singleton = NM_DNS_MANAGER (g_object_new (NM_TYPE_DNS_MANAGER, NULL));
g_assert (singleton);
}
return singleton;
}
NM_DEFINE_SINGLETON_GETTER (NMDnsManager, nm_dns_manager_get, NM_TYPE_DNS_MANAGER);
static void
init_resolv_conf_mode (NMDnsManager *self)
......
......@@ -46,12 +46,9 @@
#include "main-utils.h"
#include "nm-manager.h"
#include "nm-linux-platform.h"
#include "nm-dns-manager.h"
#include "nm-dbus-manager.h"
#include "nm-supplicant-manager.h"
#include "nm-device.h"
#include "nm-dhcp-manager.h"
#include "nm-firewall-manager.h"
#include "nm-vpn-manager.h"
#include "nm-logging.h"
#include "nm-config.h"
#include "nm-posix-signals.h"
......@@ -203,12 +200,6 @@ main (int argc, char *argv[])
gboolean wifi_enabled = TRUE, net_enabled = TRUE, wwan_enabled = TRUE, wimax_enabled = TRUE;
gboolean success, show_version = FALSE;
NMManager *manager = NULL;
gs_unref_object NMVpnManager *vpn_manager = NULL;
gs_unref_object NMDnsManager *dns_mgr = NULL;
gs_unref_object NMDBusManager *dbus_mgr = NULL;
gs_unref_object NMSupplicantManager *sup_mgr = NULL;
gs_unref_object NMDhcpManager *dhcp_mgr = NULL;
gs_unref_object NMFirewallManager *fw_mgr = NULL;
gs_unref_object NMSettings *settings = NULL;
gs_unref_object NMConfig *config = NULL;
GError *error = NULL;
......@@ -395,20 +386,6 @@ main (int argc, char *argv[])
nm_auth_manager_setup (nm_config_get_auth_polkit (config));
/* Initialize our DBus service & connection */
dbus_mgr = nm_dbus_manager_get ();
g_assert (dbus_mgr != NULL);
vpn_manager = nm_vpn_manager_get ();
g_assert (vpn_manager != NULL);
dns_mgr = nm_dns_manager_get ();
g_assert (dns_mgr != NULL);
/* Initialize DHCP manager */
dhcp_mgr = nm_dhcp_manager_get ();
g_assert (dhcp_mgr != NULL);
nm_dispatcher_init ();
settings = nm_settings_new (&error);
......@@ -431,15 +408,7 @@ main (int argc, char *argv[])
goto done;
}
/* Initialize the supplicant manager */
sup_mgr = nm_supplicant_manager_get ();
g_assert (sup_mgr != NULL);
/* Initialize Firewall manager */
fw_mgr = nm_firewall_manager_get ();
g_assert (fw_mgr != NULL);
if (!nm_dbus_manager_get_connection (dbus_mgr)) {
if (!nm_dbus_manager_get_connection (nm_dbus_manager_get ())) {
#if HAVE_DBUS_GLIB_100
nm_log_warn (LOGD_CORE, "Failed to connect to D-Bus; only private bus is available");
#else
......@@ -448,7 +417,7 @@ main (int argc, char *argv[])
#endif
} else {
/* Start our DBus service */
if (!nm_dbus_manager_start_service (dbus_mgr)) {
if (!nm_dbus_manager_start_service (nm_dbus_manager_get ())) {
nm_log_err (LOGD_CORE, "failed to start the dbus service.");
goto done;
}
......
......@@ -37,7 +37,7 @@
if (nm_logging_enabled ((level), (domain))) { \
char __prefix[30] = "auth"; \
\
if ((self) != _instance) \
if ((self) != singleton_instance) \
g_snprintf (__prefix, sizeof (__prefix), "auth[%p]", (self)); \
nm_log ((level), (domain), \
"%s: " _NM_UTILS_MACRO_FIRST(__VA_ARGS__), \
......@@ -76,7 +76,8 @@ typedef struct {
#endif
} NMAuthManagerPrivate;
static NMAuthManager *_instance = NULL;
NM_DEFINE_SINGLETON_DESTRUCTOR (NMAuthManager);
NM_DEFINE_SINGLETON_WEAK_REF (NMAuthManager);
G_DEFINE_TYPE (NMAuthManager, nm_auth_manager, G_TYPE_OBJECT)
......@@ -485,9 +486,9 @@ _dbus_new_proxy_cb (GObject *source_object,
NMAuthManager *
nm_auth_manager_get ()
{
g_return_val_if_fail (_instance, NULL);
g_return_val_if_fail (singleton_instance, NULL);
return _instance;
return singleton_instance;
}
NMAuthManager *
......@@ -495,14 +496,17 @@ nm_auth_manager_setup (gboolean polkit_enabled)
{
NMAuthManager *self;
g_return_val_if_fail (!_instance, _instance);
g_return_val_if_fail (!singleton_instance, singleton_instance);
self = g_object_new (NM_TYPE_AUTH_MANAGER,
NM_AUTH_MANAGER_POLKIT_ENABLED, polkit_enabled,
NULL);
_LOGD ("set instance");
return (_instance = self);
singleton_instance = self;
nm_singleton_instance_weak_ref_register ();
return self;
}
/*****************************************************************************/
......@@ -609,19 +613,6 @@ dispose (GObject *object)
G_OBJECT_CLASS (nm_auth_manager_parent_class)->dispose (object);
}
static void
finalize (GObject *object)
{
NMAuthManager* self = NM_AUTH_MANAGER (object);
G_OBJECT_CLASS (nm_auth_manager_parent_class)->finalize (object);
if (self == _instance) {
_instance = NULL;
_LOGD ("unset instance");
}
}
static void
nm_auth_manager_class_init (NMAuthManagerClass *klass)
{
......@@ -633,7 +624,6 @@ nm_auth_manager_class_init (NMAuthManagerClass *klass)
object_class->set_property = set_property;
object_class->constructed = constructed;
object_class->dispose = dispose;
object_class->finalize = finalize;
g_object_class_install_property
(object_class, PROP_POLKIT_ENABLED,
......
......@@ -78,20 +78,23 @@ static void nm_dbus_manager_cleanup (NMDBusManager *self, gboolean dispose);
static void start_reconnection_timeout (NMDBusManager *self);
static void object_destroyed (NMDBusManager *self, gpointer object);
NM_DEFINE_SINGLETON_DESTRUCTOR (NMDBusManager);
NM_DEFINE_SINGLETON_WEAK_REF (NMDBusManager);
NMDBusManager *
nm_dbus_manager_get (void)
{
static NMDBusManager *singleton = NULL;
static gsize once = 0;
if (g_once_init_enter (&once)) {
singleton = (NMDBusManager *) g_object_new (NM_TYPE_DBUS_MANAGER, NULL);
g_assert (singleton);
if (!nm_dbus_manager_init_bus (singleton))
start_reconnection_timeout (singleton);
singleton_instance = (NMDBusManager *) g_object_new (NM_TYPE_DBUS_MANAGER, NULL);
g_assert (singleton_instance);
nm_singleton_instance_weak_ref_register ();
if (!nm_dbus_manager_init_bus (singleton_instance))
start_reconnection_timeout (singleton_instance);
g_once_init_leave (&once, 1);
}
return singleton;
return singleton_instance;
}
/**************************************************************/
......
......@@ -50,7 +50,7 @@ typedef struct {
G_DEFINE_TYPE (NMDefaultRouteManager, nm_default_route_manager, G_TYPE_OBJECT)
static NMDefaultRouteManager *_instance;
NM_DEFINE_SINGLETON_GETTER (NMDefaultRouteManager, nm_default_route_manager_get, NM_TYPE_DEFAULT_ROUTE_MANAGER);
#define _LOG(level, addr_family, ...) \
G_STMT_START { \
......@@ -61,7 +61,7 @@ static NMDefaultRouteManager *_instance;
char __ch = __addr_family == AF_INET ? '4' : (__addr_family == AF_INET6 ? '6' : '-'); \
char __prefix[30] = "default-route"; \
\
if ((self) != _instance) \
if ((self) != singleton_instance) \
g_snprintf (__prefix, sizeof (__prefix), "default-route%c[%p]", __ch, (self)); \
else \
__prefix[STRLEN ("default-route")] = __ch; \
......@@ -1154,18 +1154,6 @@ static const VTableIP vtable_ip6 = {
/***********************************************************************************/
NMDefaultRouteManager *
nm_default_route_manager_get ()
{
if (G_UNLIKELY (!_instance)) {
_instance = NM_DEFAULT_ROUTE_MANAGER (g_object_new (NM_TYPE_DEFAULT_ROUTE_MANAGER, NULL));
g_object_add_weak_pointer (G_OBJECT (_instance), (gpointer *) &_instance);
}
return _instance;
}
/***********************************************************************************/
static gboolean
_resync_idle_now (NMDefaultRouteManager *self)
{
......
......@@ -337,18 +337,7 @@ name_owner_changed (NMDBusManager *dbus_mgr,
/*******************************************************************/
NMFirewallManager *
nm_firewall_manager_get (void)
{
static NMFirewallManager *singleton = NULL;
if (G_UNLIKELY (!singleton)) {
singleton = NM_FIREWALL_MANAGER (g_object_new (NM_TYPE_FIREWALL_MANAGER, NULL));
g_assert (singleton);
}
return singleton;
}
NM_DEFINE_SINGLETON_GETTER (NMFirewallManager, nm_firewall_manager_get, NM_TYPE_FIREWALL_MANAGER);
static void
nm_firewall_manager_init (NMFirewallManager * self)
......
......@@ -277,7 +277,6 @@ main (int argc, char *argv[])
gboolean show_version = FALSE, slaac = FALSE;
char *bad_domains = NULL, *dhcp4_hostname = NULL, *uuid = NULL;
char *iid_str = NULL, *dhcp4_clientid = NULL, *dhcp4_address = NULL;
gs_unref_object NMDhcpManager *dhcp_mgr = NULL;
GError *error = NULL;
gboolean wrote_pidfile = FALSE;
gs_free char *pidfile = NULL;
......@@ -430,11 +429,7 @@ main (int argc, char *argv[])
if (dhcp4_address) {
nm_platform_sysctl_set (nm_utils_ip4_property_path (ifname, "promote_secondaries"), "1");
/* Initialize DHCP manager */
dhcp_mgr = nm_dhcp_manager_get ();
g_assert (dhcp_mgr != NULL);
dhcp4_client = nm_dhcp_manager_start_ip4 (dhcp_mgr,
dhcp4_client = nm_dhcp_manager_start_ip4 (nm_dhcp_manager_get (),
ifname,
ifindex,
hwaddr,
......
......@@ -4824,7 +4824,7 @@ nm_manager_init (NMManager *manager)
G_CALLBACK (dbus_connection_changed_cb),
manager);
priv->vpn_manager = nm_vpn_manager_get ();
priv->vpn_manager = g_object_ref (nm_vpn_manager_get ());
g_connection = nm_dbus_manager_get_connection (priv->dbus_mgr);
......@@ -4852,10 +4852,10 @@ nm_manager_init (NMManager *manager)
nm_log_warn (LOGD_AUTOIP4, "could not initialize avahi-autoipd D-Bus proxy");
/* sleep/wake handling */
priv->sleep_monitor = nm_sleep_monitor_get ();
g_signal_connect (priv->sleep_monitor, "sleeping",
priv->sleep_monitor = g_object_ref (nm_sleep_monitor_get ());
g_signal_connect (priv->sleep_monitor, NM_SLEEP_MONITOR_SLEEPING,
G_CALLBACK (sleeping_cb), manager);
g_signal_connect (priv->sleep_monitor, "resuming",
g_signal_connect (priv->sleep_monitor, NM_SLEEP_MONITOR_RESUMING,
G_CALLBACK (resuming_cb), manager);
/* Listen for authorization changes */
......@@ -5065,7 +5065,11 @@ dispose (GObject *object)
}
g_clear_object (&priv->aipd_proxy);
g_clear_object (&priv->sleep_monitor);
if (priv->sleep_monitor) {
g_signal_handlers_disconnect_by_func (priv->sleep_monitor, sleeping_cb, manager);
g_signal_handlers_disconnect_by_func (priv->sleep_monitor, resuming_cb, manager);
g_clear_object (&priv->sleep_monitor);
}
if (priv->fw_monitor) {
g_signal_handlers_disconnect_by_func (priv->fw_monitor, firmware_dir_changed, manager);
......
......@@ -1788,7 +1788,7 @@ nm_policy_new (NMManager *manager, NMSettings *settings)
priv->fw_started_id = g_signal_connect (nm_firewall_manager_get (), "started",
G_CALLBACK (firewall_started), policy);
priv->dns_manager = nm_dns_manager_get ();
priv->dns_manager = g_object_ref (nm_dns_manager_get ());
nm_dns_manager_set_initial_hostname (priv->dns_manager, priv->orig_hostname);
priv->config_changed_id = g_signal_connect (priv->dns_manager, "config-changed",
G_CALLBACK (dns_config_changed), policy);
......@@ -1899,7 +1899,7 @@ dispose (GObject *object)
if (priv->dns_manager) {
g_signal_handler_disconnect (priv->dns_manager, priv->config_changed_id);
priv->dns_manager = NULL;
g_clear_object (&priv->dns_manager);
}
for (iter = priv->manager_ids; iter; iter = g_slist_next (iter))
......
......@@ -278,16 +278,9 @@ ck_finalize (NMSessionMonitor *monitor)
/********************************************************************/
static NMSessionMonitor *
nm_session_monitor_get (void)
{
static NMSessionMonitor *singleton = NULL;
if (!singleton)
singleton = NM_SESSION_MONITOR (g_object_new (NM_TYPE_SESSION_MONITOR, NULL));
NMSessionMonitor *nm_session_monitor_get(void);
return singleton;
}
NM_DEFINE_SINGLETON_GETTER (NMSessionMonitor, nm_session_monitor_get, NM_TYPE_SESSION_MONITOR);
/**
* nm_session_monitor_connect:
......
......@@ -243,16 +243,6 @@ nm_sleep_monitor_class_init (NMSleepMonitorClass *klass)
G_TYPE_NONE, 0);
}
NMSleepMonitor *
nm_sleep_monitor_get (void)
{
static NMSleepMonitor *singleton = NULL;
if (singleton)
return g_object_ref (singleton);
singleton = NM_SLEEP_MONITOR (g_object_new (NM_TYPE_SLEEP_MONITOR, NULL));
return singleton;
}
NM_DEFINE_SINGLETON_GETTER (NMSleepMonitor, nm_sleep_monitor_get, NM_TYPE_SLEEP_MONITOR);
/* ---------------------------------------------------------------------------------------------------- */
......@@ -133,16 +133,6 @@ nm_sleep_monitor_class_init (NMSleepMonitorClass *klass)
G_TYPE_NONE, 0);
}
NMSleepMonitor *
nm_sleep_monitor_get (void)
{
static NMSleepMonitor *singleton = NULL;
if (singleton)
return g_object_ref (singleton);
singleton = NM_SLEEP_MONITOR (g_object_new (NM_TYPE_SLEEP_MONITOR, NULL));
return singleton;
}
NM_DEFINE_SINGLETON_GETTER (NMSleepMonitor, nm_sleep_monitor_get, NM_TYPE_SLEEP_MONITOR);
/* ---------------------------------------------------------------------------------------------------- */
......@@ -50,9 +50,8 @@ G_DEFINE_TYPE (NMAgentManager, nm_agent_manager, G_TYPE_OBJECT)
NMAgentManagerPrivate))
typedef struct {
gboolean disposed;
NMDBusManager *dbus_mgr;
NMAuthManager *auth_mgr;
/* Auth chains for checking agent permissions */
GSList *chains;
......@@ -1537,35 +1536,7 @@ authority_changed_cb (NMAuthManager *auth_manager, NMAgentManager *self)
/*************************************************************/
NMAgentManager *
nm_agent_manager_get (void)
{
static NMAgentManager *singleton = NULL;
NMAgentManagerPrivate *priv;
if (singleton)
return g_object_ref (singleton);
singleton = (NMAgentManager *) g_object_new (NM_TYPE_AGENT_MANAGER, NULL);
g_assert (singleton);
priv = NM_AGENT_MANAGER_GET_PRIVATE (singleton);
priv->dbus_mgr = nm_dbus_manager_get ();
nm_dbus_manager_register_object (priv->dbus_mgr, NM_DBUS_PATH_AGENT_MANAGER, singleton);
g_signal_connect (priv->dbus_mgr,
NM_DBUS_MANAGER_NAME_OWNER_CHANGED,
G_CALLBACK (name_owner_changed_cb),
singleton);
g_signal_connect (nm_auth_manager_get (),
NM_AUTH_MANAGER_SIGNAL_CHANGED,
G_CALLBACK (authority_changed_cb),
singleton);
return singleton;
}
NM_DEFINE_SINGLETON_GETTER (NMAgentManager, nm_agent_manager_get, NM_TYPE_AGENT_MANAGER);
static void
nm_agent_manager_init (NMAgentManager *self)
......@@ -1580,23 +1551,57 @@ nm_agent_manager_init (NMAgentManager *self)
}
static void
dispose (GObject *object)
constructed (GObject *object)
{
NMAgentManagerPrivate *priv = NM_AGENT_MANAGER_GET_PRIVATE (object);
if (!priv->disposed) {
priv->disposed = TRUE;
G_OBJECT_CLASS (nm_agent_manager_parent_class)->constructed (object);
g_signal_handlers_disconnect_by_func (nm_auth_manager_get (),
G_CALLBACK (authority_changed_cb),
object);
priv->dbus_mgr = g_object_ref (nm_dbus_manager_get ());
priv->auth_mgr = g_object_ref (nm_auth_manager_get ());
nm_dbus_manager_register_object (priv->dbus_mgr, NM_DBUS_PATH_AGENT_MANAGER, object);
g_slist_free_full (priv->chains, (GDestroyNotify) nm_auth_chain_unref);
g_signal_connect (priv->dbus_mgr,
NM_DBUS_MANAGER_NAME_OWNER_CHANGED,
G_CALLBACK (name_owner_changed_cb),
object);
g_signal_connect (priv->auth_mgr,
NM_AUTH_MANAGER_SIGNAL_CHANGED,
G_CALLBACK (authority_changed_cb),
object);
}
static void
dispose (GObject *object)
{
NMAgentManagerPrivate *priv = NM_AGENT_MANAGER_GET_PRIVATE (object);
g_slist_free_full (priv->chains, (GDestroyNotify) nm_auth_chain_unref);
priv->chains = NULL;
if (priv->agents) {
g_hash_table_destroy (priv->agents);
priv->agents = NULL;
}
if (priv->requests) {
g_hash_table_destroy (priv->requests);
priv->requests = NULL;
}
priv->dbus_mgr = NULL;
if (priv->auth_mgr) {
g_signal_handlers_disconnect_by_func (priv->auth_mgr,
G_CALLBACK (authority_changed_cb),
object);
g_clear_object (&priv->auth_mgr);
}
if (priv->dbus_mgr) {
g_signal_handlers_disconnect_by_func (priv->dbus_mgr,
G_CALLBACK (name_owner_changed_cb),
object);
nm_dbus_manager_unregister_object (priv->dbus_mgr, object);
g_clear_object (&priv->dbus_mgr);
}
G_OBJECT_CLASS (nm_agent_manager_parent_class)->dispose (object);
......@@ -1610,6 +1615,7 @@ nm_agent_manager_class_init (NMAgentManagerClass *agent_manager_class)
g_type_class_add_private (agent_manager_class, sizeof (NMAgentManagerPrivate));
/* virtual methods */
object_class->constructed = constructed;
object_class->dispose = dispose;
/* Signals */
......
......@@ -24,6 +24,7 @@
#include <string.h>
#include <sys/inotify.h>
#include <glib.h>
#include <errno.h>
#include "nm-inotify-helper.h"
#include "nm-logging.h"
......@@ -55,9 +56,10 @@ nm_inotify_helper_add_watch (NMInotifyHelper *self, const char *path)
{
NMInotifyHelperPrivate *priv = NM_INOTIFY_HELPER_GET_PRIVATE (self);
int wd;
guint32 refcount;
guint refcount;