diff options
author | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2014-04-15 15:08:35 +0300 |
---|---|---|
committer | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2014-04-25 15:05:23 +0300 |
commit | 35cbfa938700049e909d8df9f4f55e4f33d09831 (patch) | |
tree | 2c350bc891be779841f8af2eddec5cf2e50d4a06 /android/avctp.c | |
parent | 87dc59894d8ea1396200a5bc66a4d2a5f7666f41 (diff) | |
download | bluez-35cbfa938700049e909d8df9f4f55e4f33d09831.tar.gz |
android/avctp: Make browsing handler return ssize_t
This makes possible to return errors such as -EAGAIN to indicate the
request would block and a response will be sent asynchronously.
Diffstat (limited to 'android/avctp.c')
-rw-r--r-- | android/avctp.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/android/avctp.c b/android/avctp.c index 2271d2c94..4556ceb0a 100644 --- a/android/avctp.c +++ b/android/avctp.c @@ -839,9 +839,15 @@ static gboolean session_browsing_cb(GIOChannel *chan, GIOCondition cond, goto send; } - packet_size += handler->cb(session, avctp->transaction, - operands, operand_count, - handler->user_data); + ret = handler->cb(session, avctp->transaction, operands, operand_count, + handler->user_data); + if (ret < 0) { + if (ret == -EAGAIN) + return TRUE; + goto failed; + } + + packet_size += ret; send: if (packet_size != 0) { |