Re: [PATCH BlueZ 1/4] btio: Handle closed channel in server_cb

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

 



Hi Iulia,

On Mon, Oct 16, 2023 at 8:49 AM Iulia Tanasescu <iulia.tanasescu@xxxxxxx> wrote:
>
> This handles G_IO_ERR and G_IO_HUP conditions in server_cb
>
> ---
>  btio/btio.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/btio/btio.c b/btio/btio.c
> index d45b8240d..c63a6d1df 100644
> --- a/btio/btio.c
> +++ b/btio/btio.c
> @@ -247,7 +247,8 @@ static gboolean server_cb(GIOChannel *io, GIOCondition cond,
>         GIOChannel *cli_io;
>
>         /* If the user closed the server */
> -       if ((cond & G_IO_NVAL) || check_nval(io))
> +       if ((cond & (G_IO_NVAL | G_IO_ERR | G_IO_HUP)) ||
> +                       check_nval(io))

I believe this was done on purpose to only check for NVAL, the other
conditions shall probably be notified back via callback so it can
process the error reported.

>                 return FALSE;
>
>         srv_sock = g_io_channel_unix_get_fd(io);
> --
> 2.39.2
>


-- 
Luiz Augusto von Dentz




[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