Return-Path: From: Andrei Emeltchenko To: linux-bluetooth@vger.kernel.org Subject: [PATCHv4 09/17] android/socket: Write channel to Android fd Date: Mon, 18 Nov 2013 15:20:46 +0200 Message-Id: <1384780854-20970-10-git-send-email-Andrei.Emeltchenko.news@gmail.com> In-Reply-To: <1384780854-20970-1-git-send-email-Andrei.Emeltchenko.news@gmail.com> References: <1384780854-20970-1-git-send-email-Andrei.Emeltchenko.news@gmail.com> Sender: linux-bluetooth-owner@vger.kernel.org List-ID: From: Andrei Emeltchenko Android framework expects to receive channel number as int. --- android/socket.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/android/socket.c b/android/socket.c index a02bb1e..bfe7ca6 100644 --- a/android/socket.c +++ b/android/socket.c @@ -363,6 +363,13 @@ static int handle_listen(void *buf) rfsock->real_sock = g_io_channel_unix_get_fd(io); servers = g_list_append(servers, rfsock); + /* TODO: Check this */ + if (write(rfsock->fd, &chan, sizeof(chan)) != sizeof(chan)) { + error("Error sending RFCOMM channel"); + cleanup_rfsock(rfsock); + return -1; + } + DBG("real_sock %d fd %d hal_fd %d", rfsock->real_sock, rfsock->fd, hal_fd); -- 1.7.10.4