From c3db3e0044c2a05be8cf311424ddc9c52062cd1e Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Wed, 27 May 2020 17:07:48 +0200 Subject: [PATCH] core: don't do anything if there are no changes in nm_settings_connection_update_timestamp() Updating the timestamp marks the keyfile database as dirty. Avoid that, if there is no change. Of course, nm_key_file_db_set_value() itself already checks whether the are any changes, and does nothing if there aren't. Simply perform the check earlier, to do nothing. --- src/settings/nm-settings-connection.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/settings/nm-settings-connection.c b/src/settings/nm-settings-connection.c index 48e3dce253..1c3e7fe34c 100644 --- a/src/settings/nm-settings-connection.c +++ b/src/settings/nm-settings-connection.c @@ -2136,12 +2136,18 @@ void nm_settings_connection_update_timestamp (NMSettingsConnection *self, guint64 timestamp) { - NMSettingsConnectionPrivate *priv = NM_SETTINGS_CONNECTION_GET_PRIVATE (self); + NMSettingsConnectionPrivate *priv; const char *connection_uuid; char sbuf[60]; g_return_if_fail (NM_IS_SETTINGS_CONNECTION (self)); + priv = NM_SETTINGS_CONNECTION_GET_PRIVATE (self); + + if ( priv->timestamp == timestamp + && priv->timestamp_set) + return; + priv->timestamp = timestamp; priv->timestamp_set = TRUE;