From 788c58f5a9c0a9439efc44c68f7ed3f5460eefed Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Thu, 19 Jul 2007 11:45:49 +0000 Subject: Don't try to process data if g_io_channel_read failed --- audio/headset.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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; -- cgit