[PATCH 02/11] gatserver: Check for disconnection when resuming

Zhenhua Zhang zhenhua.zhang at intel.com
Fri Jun 11 22:50:41 PDT 2010


If the internal GAtIO is no longer valid, treat it as if our channel was
disconnected.
---
 gatchat/gatserver.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/gatchat/gatserver.c b/gatchat/gatserver.c
index 6bb9244..3fa26a0 100644
--- a/gatchat/gatserver.c
+++ b/gatchat/gatserver.c
@@ -1164,6 +1164,11 @@ void g_at_server_resume(GAtServer *server)
 
 	server->suspended = FALSE;
 
+	if (g_at_io_get_channel(server->io) == NULL) {
+		io_disconnect(server);
+		return;
+	}
+
 	g_at_io_set_debug(server->io, server->debugf, server->debug_data);
 	g_at_io_set_read_handler(server->io, new_bytes, server);
 
-- 
1.6.3.3



More information about the ofono mailing list