diff options
| author | Michael Biebl <biebl@debian.org> | 2017-05-11 14:55:55 +0200 |
|---|---|---|
| committer | Michael Biebl <biebl@debian.org> | 2017-05-11 14:55:55 +0200 |
| commit | c333f062ddcba9b35330647bf6cbd0a07f2d786e (patch) | |
| tree | 257c3a0c74c09f4ad2328eab5b932806405f0c1c /src/settings/plugins/keyfile/nms-keyfile-connection.c | |
| parent | a222e56e103f949b148a6942e385ccca2c26d9f3 (diff) | |
New upstream version 1.8.0 upstream/1.8.0
Diffstat (limited to 'src/settings/plugins/keyfile/nms-keyfile-connection.c')
| -rw-r--r-- | src/settings/plugins/keyfile/nms-keyfile-connection.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/settings/plugins/keyfile/nms-keyfile-connection.c b/src/settings/plugins/keyfile/nms-keyfile-connection.c index ff654acf..bd07d263 100644 --- a/src/settings/plugins/keyfile/nms-keyfile-connection.c +++ b/src/settings/plugins/keyfile/nms-keyfile-connection.c @@ -58,12 +58,16 @@ commit_changes (NMSettingsConnection *connection, { char *path = NULL; GError *error = NULL; + gs_unref_object NMConnection *reread = NULL; + gboolean reread_same = FALSE; if (!nms_keyfile_writer_connection (NM_CONNECTION (connection), nm_settings_connection_get_filename (connection), NM_FLAGS_ALL (commit_reason, NM_SETTINGS_CONNECTION_COMMIT_REASON_USER_ACTION | NM_SETTINGS_CONNECTION_COMMIT_REASON_ID_CHANGED), &path, + &reread, + &reread_same, &error)) { callback (connection, error, user_data); g_clear_error (&error); @@ -89,6 +93,18 @@ commit_changes (NMSettingsConnection *connection, NMS_KEYFILE_CONNECTION_LOG_ARG (connection)); } + if (reread && !reread_same) { + gs_free_error GError *local = NULL; + + if (!nm_settings_connection_replace_settings (connection, reread, FALSE, "update-during-write", &local)) { + nm_log_warn (LOGD_SETTINGS, "keyfile: update "NMS_KEYFILE_CONNECTION_LOG_FMT" after persisting connection failed: %s", + NMS_KEYFILE_CONNECTION_LOG_ARG (connection), local->message); + } else { + nm_log_info (LOGD_SETTINGS, "keyfile: update "NMS_KEYFILE_CONNECTION_LOG_FMT" after persisting connection", + NMS_KEYFILE_CONNECTION_LOG_ARG (connection)); + } + } + g_free (path); NM_SETTINGS_CONNECTION_CLASS (nms_keyfile_connection_parent_class)->commit_changes (connection, |