Linux bluetooth development
 help / color / mirror / Atom feed
From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
To: linux-bluetooth@vger.kernel.org
Subject: [PATCH BlueZ 1/2] android/hal-audio: Fix not closing audio_sk
Date: Mon, 20 Jan 2014 14:25:26 +0200	[thread overview]
Message-ID: <1390220727-21494-1-git-send-email-luiz.dentz@gmail.com> (raw)

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

shutdown will only disconnect the peers but it is still needed to close
the file descriptor.
---
 android/hal-audio.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/android/hal-audio.c b/android/hal-audio.c
index 2f6f8c2..0b4577e 100644
--- a/android/hal-audio.c
+++ b/android/hal-audio.c
@@ -246,6 +246,7 @@ static void audio_ipc_cleanup(void)
 {
 	if (audio_sk >= 0) {
 		shutdown(audio_sk, SHUT_RDWR);
+		close(audio_sk);
 		audio_sk = -1;
 	}
 }
@@ -1090,6 +1091,7 @@ static void *ipc_handler(void *data)
 
 		if (pfd.revents & (POLLHUP | POLLERR | POLLNVAL)) {
 			info("Audio HAL: Socket closed");
+			close(audio_sk);
 			audio_sk = -1;
 		}
 
-- 
1.8.4.2


             reply	other threads:[~2014-01-20 12:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-20 12:25 Luiz Augusto von Dentz [this message]
2014-01-20 12:25 ` [PATCH BlueZ 2/2] android/A2DP: Fix sending notification on bt_a2dp_unregister Luiz Augusto von Dentz
2014-01-21 11:41   ` Luiz Augusto von Dentz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1390220727-21494-1-git-send-email-luiz.dentz@gmail.com \
    --to=luiz.dentz@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox