diff --git a/src/settings/nm-settings-connection.c b/src/settings/nm-settings-connection.c index 2726912f7..0d7fe3a8e 100644 --- a/src/settings/nm-settings-connection.c +++ b/src/settings/nm-settings-connection.c @@ -504,7 +504,7 @@ nm_settings_connection_replace_and_commit (NMSettingsConnection *self, g_return_if_fail (NM_IS_CONNECTION (new_connection)); if (nm_settings_connection_replace_settings (self, new_connection, TRUE, &error)) { - nm_settings_connection_commit_changes (self, callback ? callback : ignore_cb, user_data); + nm_settings_connection_commit_changes (self, callback, user_data); } else { if (callback) callback (self, error, user_data); @@ -533,17 +533,17 @@ nm_settings_connection_commit_changes (NMSettingsConnection *connection, gpointer user_data) { g_return_if_fail (NM_IS_SETTINGS_CONNECTION (connection)); - g_return_if_fail (callback != NULL); if (NM_SETTINGS_CONNECTION_GET_CLASS (connection)->commit_changes) { NM_SETTINGS_CONNECTION_GET_CLASS (connection)->commit_changes (connection, - callback, + callback ? callback : ignore_cb, user_data); } else { GError *error = g_error_new (NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_INTERNAL_ERROR, "%s: %s:%d commit_changes() unimplemented", __func__, __FILE__, __LINE__); - callback (connection, error, user_data); + if (callback) + callback (connection, error, user_data); g_error_free (error); } } @@ -554,17 +554,17 @@ nm_settings_connection_delete (NMSettingsConnection *connection, gpointer user_data) { g_return_if_fail (NM_IS_SETTINGS_CONNECTION (connection)); - g_return_if_fail (callback != NULL); if (NM_SETTINGS_CONNECTION_GET_CLASS (connection)->delete) { NM_SETTINGS_CONNECTION_GET_CLASS (connection)->delete (connection, - callback, + callback ? callback : ignore_cb, user_data); } else { GError *error = g_error_new (NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_INTERNAL_ERROR, "%s: %s:%d delete() unimplemented", __func__, __FILE__, __LINE__); - callback (connection, error, user_data); + if (callback) + callback (connection, error, user_data); g_error_free (error); } } diff --git a/src/settings/plugins/ifupdown/plugin.c b/src/settings/plugins/ifupdown/plugin.c index 110a0c6db..5b3ba6e06 100644 --- a/src/settings/plugins/ifupdown/plugin.c +++ b/src/settings/plugins/ifupdown/plugin.c @@ -181,13 +181,6 @@ sc_plugin_ifupdown_class_init (SCPluginIfupdownClass *req_class) NM_SYSTEM_CONFIG_INTERFACE_HOSTNAME); } -static void -ignore_cb (NMSettingsConnection *connection, - GError *error, - gpointer user_data) -{ -} - static void bind_device_to_connection (SCPluginIfupdown *self, GUdevDevice *device, @@ -228,7 +221,7 @@ bind_device_to_connection (SCPluginIfupdown *self, } g_byte_array_free (mac_address, TRUE); - nm_settings_connection_commit_changes (NM_SETTINGS_CONNECTION (exported), ignore_cb, NULL); + nm_settings_connection_commit_changes (NM_SETTINGS_CONNECTION (exported), NULL, NULL); } static void @@ -433,7 +426,7 @@ SCPluginIfupdown_init (NMSystemConfigInterface *config) exported = g_hash_table_lookup (priv->connections, block->name); if (exported) { PLUGIN_PRINT("SCPlugin-Ifupdown", "deleting %s from connections", block->name); - nm_settings_connection_delete (NM_SETTINGS_CONNECTION (exported), ignore_cb, NULL); + nm_settings_connection_delete (NM_SETTINGS_CONNECTION (exported), NULL, NULL); g_hash_table_remove (priv->connections, block->name); }