diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2011-01-18 15:07:15 +0100 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2011-01-18 15:07:15 +0100 |
commit | 39a35f57667d8fce6829dcc7dd34f4e3ad8bb65b (patch) | |
tree | 695da59b618e0f9ae3de39bf738eec50eba8d1ed /src/rtnl.c | |
parent | 9d3358012a48fa4b617ee78de8b2fcf01ee8d5d5 (diff) | |
download | connman-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.c | 15 |
1 files changed, 10 insertions, 5 deletions
@@ -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; } |