mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-06 20:00:05 +00:00
virsh: Remove needless variable
It only redundantly reflects whether pkagent != NULL. Signed-off-by: Martin Kletzander <mkletzan@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
c07cf0a686
commit
e20ad73780
@ -119,7 +119,6 @@ virshConnect(vshControl *ctl, const char *uri, bool readonly)
|
||||
bool keepalive_forced = false;
|
||||
virPolkitAgent *pkagent = NULL;
|
||||
int authfail = 0;
|
||||
bool agentCreated = false;
|
||||
|
||||
if (ctl->keepalive_interval >= 0) {
|
||||
interval = ctl->keepalive_interval;
|
||||
@ -141,12 +140,11 @@ virshConnect(vshControl *ctl, const char *uri, bool readonly)
|
||||
goto cleanup;
|
||||
|
||||
err = virGetLastError();
|
||||
if (!agentCreated &&
|
||||
if (!pkagent &&
|
||||
err && err->domain == VIR_FROM_POLKIT &&
|
||||
err->code == VIR_ERR_AUTH_UNAVAILABLE) {
|
||||
if (!pkagent && !(pkagent = virPolkitAgentCreate()))
|
||||
if (!(pkagent = virPolkitAgentCreate()))
|
||||
goto cleanup;
|
||||
agentCreated = true;
|
||||
} else if (err && err->domain == VIR_FROM_POLKIT &&
|
||||
err->code == VIR_ERR_AUTH_FAILED) {
|
||||
authfail++;
|
||||
|
Loading…
x
Reference in New Issue
Block a user