qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 2/4] char: fix return value of can_read functions on


From: Amit Shah
Subject: [Qemu-devel] [PATCH 2/4] char: fix return value of can_read functions on no input
Date: Mon, 4 Feb 2013 18:20:48 +0530

When the can_read functions report the frontend isn't ready to accept
data yet, return 'FALSE' instead of 'TRUE'.

Signed-off-by: Amit Shah <address@hidden>
---
 qemu-char.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/qemu-char.c b/qemu-char.c
index 5731d02..7fa9372 100644
--- a/qemu-char.c
+++ b/qemu-char.c
@@ -1067,7 +1067,7 @@ static gboolean pty_chr_read(GIOChannel *chan, 
GIOCondition cond, void *opaque)
     if (len > s->read_bytes)
         len = s->read_bytes;
     if (len == 0)
-        return TRUE;
+        return FALSE;
     status = g_io_channel_read_chars(s->fd, (gchar *)buf, len, &size, NULL);
     if (status != G_IO_STATUS_NORMAL) {
         pty_chr_state(chr, 0);
@@ -2237,7 +2237,7 @@ static gboolean udp_chr_read(GIOChannel *chan, 
GIOCondition cond, void *opaque)
     GIOStatus status;
 
     if (s->max_size == 0)
-        return TRUE;
+        return FALSE;
     status = g_io_channel_read_chars(s->chan, (gchar *)s->buf, sizeof(s->buf),
                                      &bytes_read, NULL);
     s->bufcnt = bytes_read;
@@ -2492,7 +2492,7 @@ static gboolean tcp_chr_read(GIOChannel *chan, 
GIOCondition cond, void *opaque)
     int len, size;
 
     if (!s->connected || s->max_size <= 0) {
-        return TRUE;
+        return FALSE;
     }
     len = sizeof(buf);
     if (len > s->max_size)
-- 
1.8.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]