changeset 1299:d53d4a448fae

hopefully fixed a freeze on solaris
author nadvornik
date Mon, 16 Feb 2009 21:01:27 +0000
parents c37f36b97173
children bd1c6e445396
files src/remote.c
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/remote.c	Sun Feb 15 19:25:55 2009 +0000
+++ b/src/remote.c	Mon Feb 16 21:01:27 2009 +0000
@@ -60,6 +60,7 @@
 {
 	RemoteClient *client = data;
 	RemoteConnection *rc;
+	GIOStatus status = G_IO_STATUS_NORMAL;
 
 	rc = client->rc;
 
@@ -71,7 +72,7 @@
 		GError *error = NULL;
 		guint termpos;
 
-		while (g_io_channel_read_line(source, &buffer, NULL, &termpos, &error) == G_IO_STATUS_NORMAL)
+		while ((status = g_io_channel_read_line(source, &buffer, NULL, &termpos, &error)) == G_IO_STATUS_NORMAL)
 			{
 			if (buffer)
 				{
@@ -109,7 +110,7 @@
 		g_list_free(queue);
 		}
 
-	if (condition & G_IO_HUP)
+	if (condition & G_IO_HUP || status == G_IO_STATUS_EOF || status == G_IO_STATUS_ERROR)
 		{
 		rc->clients = g_list_remove(rc->clients, client);