Hi Gustavo, On Thu, Aug 18, 2011 at 11:10 PM, Gustavo F. Padovan <padovan@xxxxxxxxxxxxxx> wrote: > - port_release(port); > + if (port->fd_passing == TRUE) { > + int sk = g_io_channel_unix_get_fd(port->io); > + shutdown(sk, SHUT_RDWR); > + > + g_io_channel_unref(port->io); > + port->io = NULL; > + } How about moving this code inside port_release? It is probably necessary to always call shutdown if we really want to make sure the port is release, so even if the sender disconnects from bus it doesn't mean it has released its reference, the fd may be passed again (unlikely but possible) to another process. -- Luiz Augusto von Dentz -- To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html