aboutsummaryrefslogtreecommitdiff
path: root/monitor.c
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 /monitor.c
parent8c4ec5c0269bda18bb777a64b2008088d1c632dc (diff)
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 'monitor.c')
-rw-r--r--monitor.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/monitor.c b/monitor.c
index 733440115f..759c1335c3 100644
--- a/monitor.c
+++ b/monitor.c
@@ -929,7 +929,12 @@ static int set_password(Monitor *mon, const QDict *qdict, QObject **ret_data)
}
/* Note that setting an empty password will not disable login through
* this interface. */
- return vnc_display_password(NULL, password);
+ rc = vnc_display_password(NULL, password);
+ if (rc < 0) {
+ qerror_report(QERR_SET_PASSWD_FAILED);
+ return -1;
+ }
+ return 0;
}
qerror_report(QERR_INVALID_PARAMETER, "protocol");