summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2007-07-19 11:45:49 +0000
committerJohan Hedberg <johan.hedberg@nokia.com>2007-07-19 11:45:49 +0000
commit788c58f5a9c0a9439efc44c68f7ed3f5460eefed (patch)
tree9d2ab9f32df9f0851a14d6a50bfeff77a823a55a
parent06455ab12fe0df1278899ce31ae7a771495186ea (diff)
Don't try to process data if g_io_channel_read failed
-rw-r--r--audio/headset.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/audio/headset.c b/audio/headset.c
index a95d5f46..1e57c177 100644
--- a/audio/headset.c
+++ b/audio/headset.c
@@ -208,8 +208,10 @@ static gboolean rfcomm_io_cb(GIOChannel *chan, GIOCondition cond,
err = g_io_channel_read(chan, (gchar *) buf, sizeof(buf) - 1,
&bytes_read);
- if (err != G_IO_ERROR_NONE)
+ if (err != G_IO_ERROR_NONE) {
error("Ignoring error %d", err);
+ return TRUE;
+ }
free_space = sizeof(hs->buf) - hs->data_start - hs->data_length - 1;