sim-card
/
qemu
Archived
10
0
Fork 0

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>
This commit is contained in:
Yoshiaki Tamura 2010-08-20 19:10:41 +09:00 committed by Anthony Liguori
parent 8b53a86577
commit ac71103dc6
1 changed files with 1 additions and 1 deletions

View File

@ -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);