summaryrefslogtreecommitdiff
path: root/src/rtnl.c
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2011-01-18 15:07:15 +0100
committerMarcel Holtmann <marcel@holtmann.org>2011-01-18 15:07:15 +0100
commit39a35f57667d8fce6829dcc7dd34f4e3ad8bb65b (patch)
tree695da59b618e0f9ae3de39bf738eec50eba8d1ed /src/rtnl.c
parent9d3358012a48fa4b617ee78de8b2fcf01ee8d5d5 (diff)
downloadconnman-39a35f57667d8fce6829dcc7dd34f4e3ad8bb65b.tar.gz
connman-39a35f57667d8fce6829dcc7dd34f4e3ad8bb65b.tar.bz2
connman-39a35f57667d8fce6829dcc7dd34f4e3ad8bb65b.zip
Use g_io_channel_read_chars instead of g_io_channel_read
Diffstat (limited to 'src/rtnl.c')
-rw-r--r--src/rtnl.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/rtnl.c b/src/rtnl.c
index 71424fcc..f486a187 100644
--- a/src/rtnl.c
+++ b/src/rtnl.c
@@ -1331,17 +1331,22 @@ static gboolean netlink_event(GIOChannel *chan,
{
unsigned char buf[4096];
gsize len;
- GIOError err;
+ GIOStatus status;
if (cond & (G_IO_NVAL | G_IO_HUP | G_IO_ERR))
return FALSE;
memset(buf, 0, sizeof(buf));
- err = g_io_channel_read(chan, (gchar *) buf, sizeof(buf), &len);
- if (err) {
- if (err == G_IO_ERROR_AGAIN)
- return TRUE;
+ status = g_io_channel_read_chars(chan, (gchar *) buf,
+ sizeof(buf), &len, NULL);
+
+ switch (status) {
+ case G_IO_STATUS_NORMAL:
+ break;
+ case G_IO_STATUS_AGAIN:
+ return TRUE;
+ default:
return FALSE;
}