Function return value is checked
authorSeungyoun Ju <sy39.ju@samsung.com>
Sat, 16 Feb 2013 04:26:53 +0000 (13:26 +0900)
committerSeungyoun Ju <sy39.ju@samsung.com>
Sat, 16 Feb 2013 04:26:53 +0000 (13:26 +0900)
- 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

index 68f1c67..e643c17 100644 (file)
@@ -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