* [PATCH v2] Fix not waiting for POLLERR when disconnecting SCO
@ 2011-04-19 10:38 Luiz Augusto von Dentz
2011-04-19 12:30 ` Johan Hedberg
0 siblings, 1 reply; 2+ messages in thread
From: Luiz Augusto von Dentz @ 2011-04-19 10:38 UTC (permalink / raw)
To: linux-bluetooth
From: Luiz Augusto von Dentz <luiz.dentz-von@nokia.com>
To make sure the SCO link is really disconnected we should wait for
POLLERR since POLLHUP does not necessarily means the link is
completely disconnected just that no further data can be sent/received.
Note that this depend on a fix of SCO socket shutdown in kernel to wait
for disconnect confimation to then kill/destroy the socket indicating
the err/reason using POLLERR.
---
audio/headset.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/audio/headset.c b/audio/headset.c
index c605e9d..8fc83be 100644
--- a/audio/headset.c
+++ b/audio/headset.c
@@ -2547,8 +2547,11 @@ void headset_set_state(struct audio_device *dev, headset_state_t state)
emit_property_changed(dev->conn, dev->path,
AUDIO_HEADSET_INTERFACE, "State",
DBUS_TYPE_STRING, &state_str);
+
+ /* Do not watch HUP since we need to know when the link is
+ really disconnected */
hs->sco_id = g_io_add_watch(hs->sco,
- G_IO_ERR | G_IO_HUP | G_IO_NVAL,
+ G_IO_ERR | G_IO_NVAL,
(GIOFunc) sco_cb, dev);
g_dbus_emit_signal(dev->conn, dev->path,
--
1.7.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v2] Fix not waiting for POLLERR when disconnecting SCO
2011-04-19 10:38 [PATCH v2] Fix not waiting for POLLERR when disconnecting SCO Luiz Augusto von Dentz
@ 2011-04-19 12:30 ` Johan Hedberg
0 siblings, 0 replies; 2+ messages in thread
From: Johan Hedberg @ 2011-04-19 12:30 UTC (permalink / raw)
To: Luiz Augusto von Dentz; +Cc: linux-bluetooth
Hi Luiz,
On Tue, Apr 19, 2011, Luiz Augusto von Dentz wrote:
> To make sure the SCO link is really disconnected we should wait for
> POLLERR since POLLHUP does not necessarily means the link is
> completely disconnected just that no further data can be sent/received.
>
> Note that this depend on a fix of SCO socket shutdown in kernel to wait
> for disconnect confimation to then kill/destroy the socket indicating
> the err/reason using POLLERR.
> ---
> audio/headset.c | 5 ++++-
> 1 files changed, 4 insertions(+), 1 deletions(-)
Pushed upstream. Thanks.
Johan
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-04-19 12:30 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-19 10:38 [PATCH v2] Fix not waiting for POLLERR when disconnecting SCO Luiz Augusto von Dentz
2011-04-19 12:30 ` Johan Hedberg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox