Patchwork [1/4] char: poll a frontend only if it's writable

login
register
mail settings
Submitter Amit Shah
Date Feb. 4, 2013, 12:50 p.m.
Message ID <bcd3adb27ef58494d850acddc8c21bbd267480d7.1359982059.git.amit.shah@redhat.com>
Download mbox | patch
Permalink /patch/217900/
State New
Headers show

Comments

Amit Shah - Feb. 4, 2013, 12:50 p.m.
If the frontend reports it's not writable, don't start polling it for
data yet.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
---
 qemu-char.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch

diff --git a/qemu-char.c b/qemu-char.c
index 2b714cf..5731d02 100644
--- a/qemu-char.c
+++ b/qemu-char.c
@@ -569,7 +569,7 @@  static gboolean io_watch_poll_prepare(GSource *source, gint *timeout_)
 
     iwp->max_size = iwp->fd_can_read(iwp->opaque);
     if (iwp->max_size == 0) {
-        return TRUE;
+        return FALSE;
     }
 
     return g_io_watch_funcs.prepare(source, timeout_);