summaryrefslogtreecommitdiff
path: root/src/nm-manager.c
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2018-04-17 15:29:10 +0200
committerThomas Haller <thaller@redhat.com>2018-04-24 09:03:39 +0200
commite8c3fcae2a2ba46f7ca8b0d4b0df3028d919a48a (patch)
tree4294672c68c05d3c4b294876c5854a9e64faa6d3 /src/nm-manager.c
parent9abe3dc1a48d39b3b82014ee8ea19f748d30fed7 (diff)
downloadNetworkManager-e8c3fcae2a2ba46f7ca8b0d4b0df3028d919a48a.tar.gz
manager: use nm_utils_user_data_pack() instead of explicit AddAndActivateInfo structure
Diffstat (limited to 'src/nm-manager.c')
-rw-r--r--src/nm-manager.c21
1 files changed, 3 insertions, 18 deletions
diff --git a/src/nm-manager.c b/src/nm-manager.c
index e1769082d3..f7588a320e 100644
--- a/src/nm-manager.c
+++ b/src/nm-manager.c
@@ -4507,11 +4507,6 @@ error:
/*****************************************************************************/
-typedef struct {
- NMManager *manager;
- NMActiveConnection *active;
-} AddAndActivateInfo;
-
static void
activation_add_done (NMSettings *settings,
NMSettingsConnection *new_connection,
@@ -4520,14 +4515,11 @@ activation_add_done (NMSettings *settings,
NMAuthSubject *subject,
gpointer user_data)
{
- AddAndActivateInfo *info = user_data;
NMManager *self;
gs_unref_object NMActiveConnection *active = NULL;
gs_free_error GError *local = NULL;
- self = info->manager;
- active = info->active;
- g_slice_free (AddAndActivateInfo, info);
+ nm_utils_user_data_unpack (user_data, &self, &active);
if (!error) {
nm_active_connection_set_settings_connection (active, new_connection);
@@ -4581,7 +4573,6 @@ _add_and_activate_auth_done (NMActiveConnection *active,
NMManagerPrivate *priv;
GDBusMethodInvocation *context;
gs_unref_object NMConnection *connection = NULL;
- AddAndActivateInfo *info;
GError *error = NULL;
nm_utils_user_data_unpack (user_data, &self, &context, &connection);
@@ -4603,19 +4594,13 @@ _add_and_activate_auth_done (NMActiveConnection *active,
priv = NM_MANAGER_GET_PRIVATE (self);
- info = g_slice_new (AddAndActivateInfo);
- info->manager = self;
-
- /* we pass on the reference to @active. */
- info->active = active;
-
- /* Basic sender auth checks performed; try to add the connection */
nm_settings_add_connection_dbus (priv->settings,
connection,
FALSE,
context,
activation_add_done,
- info);
+ nm_utils_user_data_pack (self,
+ active /* pass on the reference in @active to the callback */));
}
static void