From 695da89bd47708997760980c27ff3af182e548f0 Mon Sep 17 00:00:00 2001 From: Seungyoun Ju Date: Sat, 16 Feb 2013 13:26:53 +0900 Subject: [PATCH] Function return value is checked - Issues g_io_channel_read_chars()'s return value is not checked - Fix description g_io_channel_read_chars()'s return value is checked properly Change-Id: I090cf2f9ad556ca96b7d6975f1437f9fcacb5a81 --- src/mobileap_agent.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/mobileap_agent.c b/src/mobileap_agent.c index 68f1c67..e643c17 100644 --- a/src/mobileap_agent.c +++ b/src/mobileap_agent.c @@ -348,13 +348,17 @@ static gboolean __hostapd_monitor_cb(GIOChannel *source) } #else GError *err = NULL; + GIOStatus ios; - g_io_channel_read_chars(hostapd_io_channel, buf, + ios = g_io_channel_read_chars(hostapd_io_channel, buf, HOSTAPD_REQ_MAX_LEN, &read, &err); if (err != NULL) { ERR("g_io_channel_read_chars is failed : %s\n", err->message); g_error_free(err); return FALSE; + } else if (ios != G_IO_STATUS_NORMAL) { + ERR("g_io_channel_read_chars is failed : %d\n", ios); + return FALSE; } #endif -- 2.7.4