core: minor cleanup

This commit is contained in:
Thomas Haller
2019-05-04 11:00:31 +02:00
parent 5a3ffffe74
commit 4e24ebcc7b
2 changed files with 8 additions and 7 deletions

View File

@@ -365,11 +365,13 @@ nm_auth_manager_check_authorization (NMAuthManager *self,
? POLKIT_CHECK_AUTHORIZATION_FLAGS_ALLOW_USER_INTERACTION ? POLKIT_CHECK_AUTHORIZATION_FLAGS_ALLOW_USER_INTERACTION
: POLKIT_CHECK_AUTHORIZATION_FLAGS_NONE; : POLKIT_CHECK_AUTHORIZATION_FLAGS_NONE;
call_id = g_slice_new0 (NMAuthManagerCallId); call_id = g_slice_new (NMAuthManagerCallId);
call_id->self = g_object_ref (self); *call_id = (NMAuthManagerCallId) {
call_id->callback = callback; .self = g_object_ref (self),
call_id->user_data = user_data; .callback = callback,
call_id->call_numid = ++priv->call_numid_counter; .user_data = user_data,
.call_numid = ++priv->call_numid_counter,
};
c_list_link_tail (&priv->calls_lst_head, &call_id->calls_lst); c_list_link_tail (&priv->calls_lst_head, &call_id->calls_lst);
if (!priv->polkit_enabled) { if (!priv->polkit_enabled) {

View File

@@ -345,7 +345,6 @@ nm_auth_chain_add_call_unsafe (NMAuthChain *self,
gboolean allow_interaction) gboolean allow_interaction)
{ {
AuthCall *call; AuthCall *call;
NMAuthManager *auth_manager = nm_auth_manager_get ();
g_return_if_fail (self); g_return_if_fail (self);
g_return_if_fail (self->subject); g_return_if_fail (self->subject);
@@ -375,7 +374,7 @@ nm_auth_chain_add_call_unsafe (NMAuthChain *self,
* call. */ * call. */
c_list_link_front (&self->auth_call_lst_head, &call->auth_call_lst); c_list_link_front (&self->auth_call_lst_head, &call->auth_call_lst);
call->call_id = nm_auth_manager_check_authorization (auth_manager, call->call_id = nm_auth_manager_check_authorization (nm_auth_manager_get (),
self->subject, self->subject,
permission, permission,
allow_interaction, allow_interaction,