summaryrefslogtreecommitdiff
path: root/src/sdp-client.c
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2013-10-21 16:04:08 +0300
committerJohan Hedberg <johan.hedberg@intel.com>2013-10-21 16:25:06 +0300
commit073714c3ff70379131be3e19d9ccb8b85fe3f0d9 (patch)
tree42fcbb303f66b1a3131ae5732a2d679768729059 /src/sdp-client.c
parent9c9b018781323afb95418a49409c8347d74f03b0 (diff)
downloadbluez-073714c3ff70379131be3e19d9ccb8b85fe3f0d9.tar.gz
core: Fix not forwarding errors caused by SDP search properly
In case bt_search_service fails while processing (e.g. connection is dropped) the error forward is a positive value leading btd_service_connecting_complete to not change any state at all. Futhermore the error from sdp_process was completely ignored which may cause problems as well.
Diffstat (limited to 'src/sdp-client.c')
-rw-r--r--src/sdp-client.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/sdp-client.c b/src/sdp-client.c
index 2789db685..1221f5ecd 100644
--- a/src/sdp-client.c
+++ b/src/sdp-client.c
@@ -196,14 +196,15 @@ static gboolean search_process_cb(GIOChannel *chan, GIOCondition cond,
gpointer user_data)
{
struct search_context *ctxt = user_data;
- int err = 0;
+ int err;
if (cond & (G_IO_ERR | G_IO_HUP | G_IO_NVAL)) {
- err = EIO;
+ err = -EIO;
goto failed;
}
- if (sdp_process(ctxt->session) < 0)
+ err = sdp_process(ctxt->session);
+ if (err < 0)
goto failed;
return TRUE;