From 6d2f0be34593e1f359c80a40b377d3fd8a69b7be Mon Sep 17 00:00:00 2001 From: Neil Brown Date: Sun, 8 Feb 2009 13:48:19 +1100 Subject: [PATCH] Be more careful about handing EOF read from the socket. There was a case were we would spin on EOF from the socket. --- src/gsm0710muxd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gsm0710muxd.c b/src/gsm0710muxd.c index 70d41cf..ca67b12 100644 --- a/src/gsm0710muxd.c +++ b/src/gsm0710muxd.c @@ -607,7 +607,8 @@ gboolean pseudo_device_read(GIOChannel *source, GIOCondition condition, gpointer unsigned char buf[4096]; //information from virtual port int len = read(channel->fd, buf + channel->remaining, sizeof(buf) - channel->remaining); - if (!channel->opened) + + if (len > 0 && !channel->opened) { LOG(LOG_WARNING, "Write to a channel which wasn't acked to be open."); write_frame(channel->id, NULL, 0, GSM0710_TYPE_SABM | GSM0710_PF); -- 2.39.5