summaryrefslogtreecommitdiff
path: root/ui
diff options
context:
space:
mode:
authorLuiz Capitulino <lcapitulino@redhat.com>2011-12-07 10:19:10 -0200
committerLuiz Capitulino <lcapitulino@redhat.com>2012-01-18 10:23:38 -0200
commita6aa9d3e2681199d159963e46524625d90669619 (patch)
tree4372e0694baa343a67169491f7b20f0916376be2 /ui
parent8c4ec5c0269bda18bb777a64b2008088d1c632dc (diff)
downloadqemu-a6aa9d3e2681199d159963e46524625d90669619.tar.gz
vnc: Simplify vnc_display_password()
Drop the qerror_report() call from it and let its callers set the error themselves. This also allows for dropping the 'ret' variable. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Diffstat (limited to 'ui')
-rw-r--r--ui/vnc.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/ui/vnc.c b/ui/vnc.c
index 1869a7adea..16b79ec423 100644
--- a/ui/vnc.c
+++ b/ui/vnc.c
@@ -2686,19 +2686,16 @@ int vnc_display_disable_login(DisplayState *ds)
int vnc_display_password(DisplayState *ds, const char *password)
{
- int ret = 0;
VncDisplay *vs = ds ? (VncDisplay *)ds->opaque : vnc_display;
if (!vs) {
- ret = -EINVAL;
- goto out;
+ return -EINVAL;
}
if (!password) {
/* This is not the intention of this interface but err on the side
of being safe */
- ret = vnc_display_disable_login(ds);
- goto out;
+ return vnc_display_disable_login(ds);
}
if (vs->password) {
@@ -2707,11 +2704,8 @@ int vnc_display_password(DisplayState *ds, const char *password)
}
vs->password = g_strdup(password);
vs->auth = VNC_AUTH_VNC;
-out:
- if (ret != 0) {
- qerror_report(QERR_SET_PASSWD_FAILED);
- }
- return ret;
+
+ return 0;
}
int vnc_display_pw_expire(DisplayState *ds, time_t expires)