mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-04 23:50:16 +01:00
ifcfg-rh: take reference to nm_inotifiy_helper_get() singleton in NMIfcfgConnection
https://bugzilla.redhat.com/show_bug.cgi?id=1253330
This commit is contained in:
parent
8810036895
commit
088e606fcc
1 changed files with 16 additions and 2 deletions
|
|
@ -68,6 +68,8 @@ typedef struct {
|
|||
|
||||
gulong devtimeout_link_changed_handler;
|
||||
guint devtimeout_timeout_id;
|
||||
|
||||
NMInotifyHelper *inotify_helper;
|
||||
} NMIfcfgConnectionPrivate;
|
||||
|
||||
enum {
|
||||
|
|
@ -85,6 +87,14 @@ enum {
|
|||
|
||||
static guint signals[LAST_SIGNAL] = { 0 };
|
||||
|
||||
static NMInotifyHelper *
|
||||
_get_inotify_helper (NMIfcfgConnectionPrivate *priv)
|
||||
{
|
||||
if (!priv->inotify_helper)
|
||||
priv->inotify_helper = g_object_ref (nm_inotify_helper_get ());
|
||||
return priv->inotify_helper;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
devtimeout_ready (gpointer user_data)
|
||||
{
|
||||
|
|
@ -265,7 +275,7 @@ path_watch_stop (NMIfcfgConnection *self)
|
|||
NMIfcfgConnectionPrivate *priv = NM_IFCFG_CONNECTION_GET_PRIVATE (self);
|
||||
NMInotifyHelper *ih;
|
||||
|
||||
ih = nm_inotify_helper_get ();
|
||||
ih = _get_inotify_helper (priv);
|
||||
|
||||
if (priv->ih_event_id) {
|
||||
g_signal_handler_disconnect (ih, priv->ih_event_id);
|
||||
|
|
@ -319,7 +329,9 @@ filename_changed (GObject *object,
|
|||
priv->route6file = utils_get_route6_path (ifcfg_path);
|
||||
|
||||
if (nm_config_get_monitor_connection_files (nm_config_get ())) {
|
||||
NMInotifyHelper *ih = nm_inotify_helper_get ();
|
||||
NMInotifyHelper *ih;
|
||||
|
||||
ih = _get_inotify_helper (priv);
|
||||
|
||||
priv->ih_event_id = g_signal_connect (ih, "event", G_CALLBACK (files_changed_cb), self);
|
||||
priv->file_wd = nm_inotify_helper_add_watch (ih, ifcfg_path);
|
||||
|
|
@ -514,6 +526,8 @@ dispose (GObject *object)
|
|||
priv->devtimeout_timeout_id = 0;
|
||||
}
|
||||
|
||||
g_clear_object (&priv->inotify_helper);
|
||||
|
||||
G_OBJECT_CLASS (nm_ifcfg_connection_parent_class)->dispose (object);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue