slackbuilds_ponce/network/NetworkManager/patches/keyfile-quiet-keyfile-plugin-when-re-read-connection.patch

49 lines
1.7 KiB
Diff
Raw Normal View History

From 4a15282e97a53d3df9062ec8e7e59288ad61e6f2 Mon Sep 17 00:00:00 2001
From: Dan Williams <dcbw@redhat.com>
Date: Wed, 10 Nov 2010 16:14:51 +0100
Subject: [PATCH 3/3] keyfile: quiet keyfile 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/keyfile/plugin.c | 11 ++++++++---
1 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/system-settings/plugins/keyfile/plugin.c b/system-settings/plugins/keyfile/plugin.c
index 27ae0a0..f57a4b6 100644
--- a/system-settings/plugins/keyfile/plugin.c
+++ b/system-settings/plugins/keyfile/plugin.c
@@ -203,15 +203,18 @@ dir_changed (GFileMonitor *monitor,
break;
case G_FILE_MONITOR_EVENT_CREATED:
case G_FILE_MONITOR_EVENT_CHANGES_DONE_HINT:
- PLUGIN_PRINT (KEYFILE_PLUGIN_NAME, "updating %s", name);
-
if (connection) {
/* Update */
NMKeyfileConnection *tmp;
tmp = nm_keyfile_connection_new (name, &error);
if (tmp) {
- update_connection_settings (connection, tmp);
+ if (!nm_connection_compare (NM_CONNECTION (connection),
+ NM_CONNECTION (tmp),
+ NM_SETTING_COMPARE_FLAG_EXACT)) {
+ PLUGIN_PRINT (KEYFILE_PLUGIN_NAME, "updating %s", name);
+ update_connection_settings (connection, tmp);
+ }
g_object_unref (tmp);
} else {
/* Error; remove the connection */
@@ -221,6 +224,8 @@ dir_changed (GFileMonitor *monitor,
remove_connection (SC_PLUGIN_KEYFILE (config), connection, name);
}
} else {
+ PLUGIN_PRINT (KEYFILE_PLUGIN_NAME, "updating %s", name);
+
/* New */
connection = nm_keyfile_connection_new (name, &error);
if (connection) {
--
1.7.3.4