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>
This commit is contained in:
Luiz Capitulino 2011-12-07 10:19:10 -02:00
parent 8c4ec5c026
commit a6aa9d3e26
3 changed files with 10 additions and 12 deletions

View file

@ -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");