diff options
author | Thomas Haller <thaller@redhat.com> | 2019-01-22 12:15:03 +0100 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2019-02-05 08:27:42 +0100 |
commit | 82472c557cc966b14d3e1186605a7fc3e37dc17d (patch) | |
tree | c4b998647ccd184d8f8e99efcceb754f3985cc63 | |
parent | d68bdce206d97e4f1a08c7568b7f2f3318a4ee88 (diff) | |
download | NetworkManager-82472c557cc966b14d3e1186605a7fc3e37dc17d.tar.gz |
clients/secret-agent: use nm-utils error reason for callback while disposing NMSecretAgentSimple
No caller cared about the NM_SECRET_AGENT_ERROR_AGENT_CANCELED reason.
In particular, because previously the requests would keep the secret-agent
instance alive, and this never happend.
Also, NM_SECRET_AGENT_ERROR_AGENT_CANCELED precicley exists for
NMSecretAgentOld:cancel_get_secrets() (as documented). During finalize
we are not cancelled -- at least not the same way as
cancel_get_secrets(). Setting NM_SECRET_AGENT_ERROR_AGENT_CANCELED
is wrong.
Anyway, we have a default error for such cases already.
-rw-r--r-- | clients/common/nm-secret-agent-simple.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/clients/common/nm-secret-agent-simple.c b/clients/common/nm-secret-agent-simple.c index 2c83de44b3..b4530af61d 100644 --- a/clients/common/nm-secret-agent-simple.c +++ b/clients/common/nm-secret-agent-simple.c @@ -1135,15 +1135,12 @@ dispose (GObject *object) g_hash_table_iter_init (&iter, priv->requests); while (g_hash_table_iter_next (&iter, NULL, (gpointer *) &request)) { - if (!error) { - g_set_error (&error, - NM_SECRET_AGENT_ERROR, - NM_SECRET_AGENT_ERROR_AGENT_CANCELED, - "The secret agent is going away"); - } + if (!error) + nm_utils_error_set_cancelled (&error, TRUE, "NMSecretAgentSimple"); request->callback (NM_SECRET_AGENT_OLD (object), request->connection, - NULL, error, + NULL, + error, request->callback_data); g_hash_table_iter_remove (&iter); } |