From: Andrzej Kaczmarek Date: Wed, 4 Jun 2014 15:14:45 +0000 (+0200) Subject: profiles/audio: Fix propagation of EHOSTDOWN error X-Git-Tag: submit/tizen/20140606.095742^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bb3a919f75fcd5b353ba03bae7afca947dbc7ef9;p=platform%2Fupstream%2Fbluez.git profiles/audio: Fix propagation of EHOSTDOWN error EHOSTDOWN error is now overwritten by EIO and once it's passed to device_profile_connected it triggers connection of another profiles while it should actually stop connecting them. Change-Id: I2a2f802c582214170f7a2c8d89a550c72d07efab Signed-off-by: Sebastian Chlad --- diff --git a/profiles/audio/sink.c b/profiles/audio/sink.c index d16af23..da8992e 100644 --- a/profiles/audio/sink.c +++ b/profiles/audio/sink.c @@ -229,11 +229,14 @@ static void discovery_complete(struct avdtp *session, GSList *seps, struct avdtp if (err) { avdtp_unref(sink->session); sink->session = NULL; - if (avdtp_error_category(err) == AVDTP_ERRNO - && avdtp_error_posix_errno(err) != EHOSTDOWN) { - perr = -EAGAIN; - } else - perr = -EIO; + + perr = -avdtp_error_posix_errno(err); + if (perr != -EHOSTDOWN) { + if (avdtp_error_category(err) == AVDTP_ERRNO) + perr = -EAGAIN; + else + perr = -EIO; + } goto failed; } diff --git a/profiles/audio/source.c b/profiles/audio/source.c index 843b3e8..b0abaa3 100644 --- a/profiles/audio/source.c +++ b/profiles/audio/source.c @@ -229,11 +229,14 @@ static void discovery_complete(struct avdtp *session, GSList *seps, struct avdtp if (err) { avdtp_unref(source->session); source->session = NULL; - if (avdtp_error_category(err) == AVDTP_ERRNO - && avdtp_error_posix_errno(err) != EHOSTDOWN) { - perr = -EAGAIN; - } else - perr = -EIO; + + perr = -avdtp_error_posix_errno(err); + if (perr != -EHOSTDOWN) { + if (avdtp_error_category(err) == AVDTP_ERRNO) + perr = -EAGAIN; + else + perr = -EIO; + } goto failed; }