Fix: GAtMux channels should return EAGAIN
authorDenis Kenzior <denkenz@gmail.com>
Wed, 14 Apr 2010 15:38:31 +0000 (10:38 -0500)
committerDenis Kenzior <denkenz@gmail.com>
Wed, 14 Apr 2010 15:39:47 +0000 (10:39 -0500)
GAtChat uses non-blocking semantics, so the GAtMux channels should
return the EAGAIN status to make GAtChat work properly.

gatchat/gatmux.c

index b70f6a0..139edd2 100644 (file)
@@ -433,6 +433,9 @@ static GIOStatus channel_read(GIOChannel *channel, gchar *buf, gsize count,
 
        *bytes_read = ring_buffer_read(mux_channel->buffer, buf, avail);
 
+       if (*bytes_read == 0)
+               return G_IO_STATUS_AGAIN;
+
        return G_IO_STATUS_NORMAL;
 }