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/config.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/config.c')
-rw-r--r-- | src/config.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/config.c b/src/config.c index 9dd09115..e4dfcd90 100644 --- a/src/config.c +++ b/src/config.c @@ -421,20 +421,22 @@ static gboolean inotify_data(GIOChannel *channel, GIOCondition cond, char buffer[256]; char *next_event; gsize bytes_read; - GIOError err; + GIOStatus status; if (cond & (G_IO_NVAL | G_IO_ERR | G_IO_HUP)) { inotify_watch = 0; return FALSE; } - err = g_io_channel_read(channel, buffer, - sizeof(buffer) - 1, &bytes_read); - - if (err != G_IO_ERROR_NONE) { - if (err == G_IO_ERROR_AGAIN) - return TRUE; + status = g_io_channel_read_chars(channel, buffer, + sizeof(buffer) -1, &bytes_read, NULL); + switch (status) { + case G_IO_STATUS_NORMAL: + break; + case G_IO_STATUS_AGAIN: + return TRUE; + default: connman_error("Reading from inotify channel failed"); inotify_watch = 0; return FALSE; |