vnc: avoid Yoda conditionals

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
Paolo Bonzini 2012-10-18 09:06:21 +02:00
parent 90119816e3
commit c1c1619c8b

View File

@ -3068,7 +3068,7 @@ int vnc_display_open(DisplayState *ds, const char *display)
vs->lsock = unix_connect(display+5, NULL);
else
vs->lsock = inet_connect(display, NULL);
if (-1 == vs->lsock) {
if (vs->lsock < 0) {
g_free(vs->display);
vs->display = NULL;
return -1;
@ -3090,7 +3090,7 @@ int vnc_display_open(DisplayState *ds, const char *display)
vs->lsock = inet_listen(display, dpy, 256,
SOCK_STREAM, 5900, NULL);
}
if (-1 == vs->lsock) {
if (vs->lsock < 0) {
g_free(dpy);
return -1;
} else {