diff options
author | Luiz Augusto von Dentz <luiz.dentz-von@nokia.com> | 2011-04-19 13:38:10 +0300 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@nokia.com> | 2011-04-19 15:29:42 +0300 |
commit | c28669fd698337cf04054a60aa78d1db5f460b5d (patch) | |
tree | 00f81b33c6b93722ddafa006d99515ae5fdf65a2 /audio | |
parent | 23de0235824c1f29f5a0e5a915008b525af6d49e (diff) | |
download | bluez-c28669fd698337cf04054a60aa78d1db5f460b5d.tar.gz |
Fix not waiting for POLLERR when disconnecting SCO
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.
Diffstat (limited to 'audio')
-rw-r--r-- | audio/headset.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/audio/headset.c b/audio/headset.c index 2e4f6ca3..33c3d850 100644 --- a/audio/headset.c +++ b/audio/headset.c @@ -2550,8 +2550,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, |