summaryrefslogtreecommitdiff
path: root/profiles
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2016-07-28 16:45:30 +0300
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2016-07-29 14:12:49 +0300
commitf9705b3f4bf1941432f836406ebb98365f939c3a (patch)
treed26681e187efa1de858805d370b24eddd1ad1f94 /profiles
parent4ea44dc5cca7e4c6569103bdaa9e5c8a1a130d73 (diff)
downloadbluez-f9705b3f4bf1941432f836406ebb98365f939c3a.tar.gz
audio/a2dp: Fix always setting -EAGAIN for all errors
avdtp_error_posix_errno always return the posix errno not the negative one which is then assigned to perror negative and then again as negative in the switch statement making it assume the original value which is the positive errno which don't match with the expected values which are negative causing -EAGAIN to always be returned.
Diffstat (limited to 'profiles')
-rw-r--r--profiles/audio/a2dp.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/profiles/audio/a2dp.c b/profiles/audio/a2dp.c
index b391fc2cc..db0736d68 100644
--- a/profiles/audio/a2dp.c
+++ b/profiles/audio/a2dp.c
@@ -235,11 +235,11 @@ static int error_to_errno(struct avdtp_error *err)
if (avdtp_error_category(err) != AVDTP_ERRNO)
return -EIO;
- perr = -avdtp_error_posix_errno(err);
- switch (-perr) {
- case -EHOSTDOWN:
- case -ECONNABORTED:
- return perr;
+ perr = avdtp_error_posix_errno(err);
+ switch (perr) {
+ case EHOSTDOWN:
+ case ECONNABORTED:
+ return -perr;
default:
/*
* An unexpect error has occurred setup may be attempted again.