From: Yoshiaki Tamura Date: Fri, 20 Aug 2010 10:10:41 +0000 (+0900) Subject: vnc: check fd before calling qemu_set_fd_handler2() in vnc_client_write() X-Git-Tag: v0.14.0-rc0~765 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ac71103dc6b408775ae72067790ab367912f75ec;p=thirdparty%2Fqemu.git 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 Signed-off-by: Anthony Liguori --- diff --git a/ui/vnc.c b/ui/vnc.c index 7fc40acae85..c7a18311f08 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);