From d32a29ec5285b3f44bf36b07bfec85703ac041ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= Date: Wed, 10 Nov 2010 17:28:36 +0100 Subject: [PATCH] ifcfg-rh: quiet ifcfg-rh plugin when re-read connection is the same as in-memory one It occurs, for example, when NM updates connection's timestamp. --- system-settings/plugins/ifcfg-rh/plugin.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/system-settings/plugins/ifcfg-rh/plugin.c b/system-settings/plugins/ifcfg-rh/plugin.c index e6dfa5bcea..37bf97280c 100644 --- a/system-settings/plugins/ifcfg-rh/plugin.c +++ b/system-settings/plugins/ifcfg-rh/plugin.c @@ -218,8 +218,6 @@ connection_changed_handler (SCPluginIfcfg *plugin, g_return_if_fail (do_remove != NULL); g_return_if_fail (do_new != NULL); - PLUGIN_PRINT (IFCFG_PLUGIN_NAME, "updating %s", path); - new = (NMIfcfgConnection *) nm_ifcfg_connection_new (path, &error, &ignore_error); if (!new) { /* errors reading connection; remove it */ @@ -234,8 +232,19 @@ connection_changed_handler (SCPluginIfcfg *plugin, return; } + /* Successfully read connection changes */ + /* When the connections are the same, nothing is done */ + if (nm_connection_compare (NM_CONNECTION (connection), + NM_CONNECTION (new), + NM_SETTING_COMPARE_FLAG_EXACT)) { + g_object_unref (new); + return; + } + + PLUGIN_PRINT (IFCFG_PLUGIN_NAME, "updating %s", path); + old_unmanaged = nm_ifcfg_connection_get_unmanaged_spec (NM_IFCFG_CONNECTION (connection)); new_unmanaged = nm_ifcfg_connection_get_unmanaged_spec (NM_IFCFG_CONNECTION (new));