summaryrefslogtreecommitdiffstats
path: root/network/NetworkManager/patches/keyfile-quiet-keyfile-plugin-when-re-read-connection.patch
blob: 8e2a32217d601ca8eb3ae51f6dbfb829f0ba8137 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
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