aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYoshiaki Tamura <tamura.yoshiaki@lab.ntt.co.jp>2010-08-20 19:10:41 +0900
committerAnthony Liguori <aliguori@us.ibm.com>2010-08-22 16:48:23 -0500
commitac71103dc6b408775ae72067790ab367912f75ec (patch)
treebe00bb7a9fffa46f30a2a54c28912d302808d2e6
parent8b53a865772789a3402a44aa80169f8dd728eba2 (diff)
vnc: check fd before calling qemu_set_fd_handler2() in vnc_client_write()
Setting fd = -1 to qemu_set_fd_handler2() causes bus error at FD_SET in main_loop_wait(). Signed-off-by: Yoshiaki Tamura <tamura.yoshiaki@lab.ntt.co.jp> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
-rw-r--r--ui/vnc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ui/vnc.c b/ui/vnc.c
index 7fc40acae8..c7a18311f0 100644
--- a/ui/vnc.c
+++ b/ui/vnc.c
@@ -1184,7 +1184,7 @@ void vnc_client_write(void *opaque)
vnc_lock_output(vs);
if (vs->output.offset) {
vnc_client_write_locked(opaque);
- } else {
+ } else if (vs->csock != -1) {
qemu_set_fd_handler2(vs->csock, NULL, vnc_client_read, NULL, vs);
}
vnc_unlock_output(vs);