From 76ee139107d1d181d6db8ac1b0bcc452be2d42dd Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Wed, 31 Dec 2014 00:40:43 +0100 Subject: [PATCH] ifcfg-rh: don't reload connection in connection_ifcfg_changed() if monitoring is not enabled This was not really an error, because NMIfcfgConnection would not watch the files if monitoring is not enabled. Still do it, because it feels more correct. (cherry picked from commit 236226a590a99c737293b2fe0df547276a7a1955) --- src/settings/plugins/ifcfg-rh/plugin.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/settings/plugins/ifcfg-rh/plugin.c b/src/settings/plugins/ifcfg-rh/plugin.c index 06c3c9f0c7..b7efa8643a 100644 --- a/src/settings/plugins/ifcfg-rh/plugin.c +++ b/src/settings/plugins/ifcfg-rh/plugin.c @@ -128,15 +128,22 @@ typedef struct { static void connection_ifcfg_changed (NMIfcfgConnection *connection, gpointer user_data) { - SCPluginIfcfg *plugin = SC_PLUGIN_IFCFG (user_data); + SCPluginIfcfg *self = SC_PLUGIN_IFCFG (user_data); + SCPluginIfcfgPrivate *priv = SC_PLUGIN_IFCFG_GET_PRIVATE (self); const char *path; path = nm_settings_connection_get_filename (NM_SETTINGS_CONNECTION (connection)); g_return_if_fail (path != NULL); - _LOGD ("connection_ifcfg_changed("NM_IFCFG_CONNECTION_LOG_FMTD")", NM_IFCFG_CONNECTION_LOG_ARGD (connection)); - update_connection (plugin, NULL, path, connection, TRUE, NULL, NULL); + if (!priv->ifcfg_monitor) { + _LOGD ("connection_ifcfg_changed("NM_IFCFG_CONNECTION_LOG_FMTD"): %s", NM_IFCFG_CONNECTION_LOG_ARGD (connection), "ignore event"); + return; + } + + _LOGD ("connection_ifcfg_changed("NM_IFCFG_CONNECTION_LOG_FMTD"): %s", NM_IFCFG_CONNECTION_LOG_ARGD (connection), "reload"); + + update_connection (self, NULL, path, connection, TRUE, NULL, NULL); } static void