profile: Fix printing error when disconnecting
Luiz Augusto von Dentz
maintainerPATCH 1/1 profile: Fix printing error when disconnecting
From: Luiz Augusto von Dentz <[email protected]>
Some profiles may shutdown the socket when disconnecting which can cause the following error:
bluetoothd[816]: Unable to get io data for hfp_hf: getpeername: Transport endpoint is not connected (107)
--- src/profile.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-)
src/profile.c +2 -9
@@ -787,22 +787,15 @@ static gboolean ext_io_disconnected(GIOChannel *io, GIOCondition cond, {struct ext_io *conn = user_data;struct ext_profile *ext = conn->ext; -GError *gerr =NULL ;char addr[18 ];if (cond &G_IO_NVAL )return FALSE; -bt_io_get (io, &gerr,BT_IO_OPT_DEST , addr,BT_IO_OPT_INVALID ); -if (gerr !=NULL ) { -error ("Unable to get io data for %s: %s" , - ext->name, gerr->message); -g_error_free (gerr); - goto drop; - } +ba2str (device_get_address (conn->device), addr);DBG ("%s disconnected from %s" , ext->name, addr); -drop: +if (conn->service) {if (btd_service_get_state (conn->service) ==BTD_SERVICE_STATE_CONNECTING )
Signature · 1 line
2.13.5