summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2009-02-24 17:50:04 +0200
committerJohan Hedberg <johan.hedberg@nokia.com>2009-02-24 17:50:04 +0200
commit895239acf05077c7700875cb722e50bfa8b45ead (patch)
tree2a14f7543196ea2968dd049564b279f3e21c9372
parent4594c36cf35c1ce6231e8b09111b3bc14d30b292 (diff)
Only call g_io_channel_shutdown if the connection was actually successfull
-rw-r--r--audio/control.c3
-rw-r--r--input/device.c3
-rw-r--r--src/device.c3
3 files changed, 6 insertions, 3 deletions
diff --git a/audio/control.c b/audio/control.c
index 5be51fe7..c11151e2 100644
--- a/audio/control.c
+++ b/audio/control.c
@@ -617,7 +617,8 @@ static void avctp_connect_cb(GIOChannel *chan, GError *err, gpointer data)
if (!session) {
debug("avctp_connect_cb: session removed while connecting");
- g_io_channel_shutdown(chan, TRUE, NULL);
+ if (!err)
+ g_io_channel_shutdown(chan, TRUE, NULL);
g_io_channel_unref(chan);
return;
}
diff --git a/input/device.c b/input/device.c
index d9db92db..a41df177 100644
--- a/input/device.c
+++ b/input/device.c
@@ -734,7 +734,8 @@ failed:
g_io_channel_shutdown(iconn->ctrl_io, FALSE, NULL);
if (iconn->intr_io) {
- g_io_channel_shutdown(iconn->intr_io, FALSE, NULL);
+ if (!conn_err)
+ g_io_channel_shutdown(iconn->intr_io, FALSE, NULL);
g_io_channel_unref(iconn->intr_io);
iconn->intr_io = NULL;
}
diff --git a/src/device.c b/src/device.c
index 582f659f..9b32379a 100644
--- a/src/device.c
+++ b/src/device.c
@@ -1653,7 +1653,8 @@ static void bonding_connect_cb(GIOChannel *io, GError *err, gpointer user_data)
uint16_t handle;
if (!device->bonding) {
- g_io_channel_shutdown(io, TRUE, NULL);
+ if (!err)
+ g_io_channel_shutdown(io, TRUE, NULL);
return;
}