xfreerdp: return correct logical value, if authentication failed.

Signed-off-by: Rex Tsai <rex.tsai@canonical.com>
This commit is contained in:
Mike Carifio 2012-06-06 17:19:30 +08:00 committed by Rex Tsai
parent 28075f5ebb
commit 88f2e84e5e
2 changed files with 10 additions and 7 deletions

View File

@ -1083,15 +1083,18 @@ int xfreerdp_run(freerdp* instance)
memset(wfds, 0, sizeof(wfds));
memset(&timeout, 0, sizeof(struct timeval));
if (!freerdp_connect(instance))
{
xf_free(((xfContext*) instance->context)->xfi);
return XF_EXIT_CONN_FAILED;
}
boolean status = freerdp_connect(instance);
/* Connection succeeded. --authonly ? */
if (instance->settings->authentication_only) {
freerdp_disconnect(instance);
exit(0);
fprintf(stderr, "%s:%d: Authentication only, exit status %d\n", __FILE__, __LINE__, !status);
exit(!status);
}
if (!status)
{
xf_free(((xfContext*) instance->context)->xfi);
return XF_EXIT_CONN_FAILED;
}
xfi = ((xfContext*) instance->context)->xfi;

View File

@ -69,7 +69,7 @@ boolean freerdp_connect(freerdp* instance)
// --authonly tests the connection without a UI
if (instance->settings->authentication_only) {
fprintf(stderr, "%s:%d: Authentication only, exit status %d\n", __FILE__, __LINE__, !status);
return true;
return status;
}
if (status)