diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2014-06-20 16:57:28 +0100 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2014-06-20 16:57:28 +0100 |
commit | 9d3c512021f7363f5877abd975070d08b02ba65c (patch) | |
tree | e9229e1519add00d2e066dd4b926100d23017132 | |
parent | e8e23b7dcf1466a11061bcb1da454489187bbb97 (diff) | |
parent | eb214ff8ef6cceec348f3ad1643b39443fe07910 (diff) |
Merge remote-tracking branch 'remotes/kraxel/tags/pull-vnc-20140619-1' into staging
vnc: cleanups and fixes
# gpg: Signature made Thu 19 Jun 2014 12:02:09 BST using RSA key ID D3E87138
# gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>"
# gpg: aka "Gerd Hoffmann <gerd@kraxel.org>"
# gpg: aka "Gerd Hoffmann (private) <kraxel@gmail.com>"
* remotes/kraxel/tags/pull-vnc-20140619-1:
vnc: fix screen updates
vnc: Drop superfluous conditionals around g_strdup()
vnc: Drop superfluous conditionals around g_free()
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
-rw-r--r-- | ui/vnc-tls.c | 6 | ||||
-rw-r--r-- | ui/vnc.c | 18 |
2 files changed, 9 insertions, 15 deletions
diff --git a/ui/vnc-tls.c b/ui/vnc-tls.c index 50275de64f..63923265fd 100644 --- a/ui/vnc-tls.c +++ b/ui/vnc-tls.c @@ -443,10 +443,8 @@ static int vnc_set_x509_credential(VncDisplay *vd, { struct stat sb; - if (*cred) { - g_free(*cred); - *cred = NULL; - } + g_free(*cred); + *cred = NULL; *cred = g_malloc(strlen(certdir) + strlen(filename) + 2); @@ -935,6 +935,9 @@ static int vnc_update_client(VncState *vs, int has_dirty, bool sync) } vnc_job_push(job); + if (sync) { + vnc_jobs_join(vs); + } vs->force_update = 0; return n; } @@ -2972,10 +2975,8 @@ static void vnc_display_close(DisplayState *ds) if (!vs) return; - if (vs->display) { - g_free(vs->display); - vs->display = NULL; - } + g_free(vs->display); + vs->display = NULL; if (vs->lsock != -1) { qemu_set_fd_handler2(vs->lsock, NULL, NULL, NULL, NULL); close(vs->lsock); @@ -3010,13 +3011,8 @@ int vnc_display_password(DisplayState *ds, const char *password) return -EINVAL; } - if (vs->password) { - g_free(vs->password); - vs->password = NULL; - } - if (password) { - vs->password = g_strdup(password); - } + g_free(vs->password); + vs->password = g_strdup(password); return 0; } |