Re: [PATCH 5/5] serial: Add support to Disconnect fd passing connections

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux