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.
This commit is contained in:
Thomas Haller 2020-05-27 17:07:48 +02:00
parent 6f3ae8a563
commit c3db3e0044
No known key found for this signature in database
GPG key ID: 29C2366E4DFC5728

View file

@ -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;