Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp2638623rdg; Mon, 16 Oct 2023 10:06:28 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGvc/O/StxEd4XALhdZez2g9A2mIjyEE1OSrTa6TiNqNGt5kiv4tPtzPQyLg5UN10/dtcPv X-Received: by 2002:a05:6a21:33a1:b0:169:3769:2739 with SMTP id yy33-20020a056a2133a100b0016937692739mr32772852pzb.14.1697475988448; Mon, 16 Oct 2023 10:06:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697475988; cv=none; d=google.com; s=arc-20160816; b=i7nbTMofSrB08BQyTRes8lKWDQiJfMjuFCHxBJKOXZBlpOnJ/3bXwR/HrE1RU/iaE2 QywnLldNwWnQ9VHiXi5MO9reB7k6BBTMvZrg3E2yf9OLtlwLWOLOfhyiAB0B0yMNxau3 5wwwyrxedjbGB5KZ28guKJkswz5Mk9R+3bD4uVKMbGI0BW6S2GRRf0eML1JjhdHeFUf/ jw4clshThqiFZy45vSu2uiuBWlczMZcPNbsZjum84/iEec3geYR+hZS1Vp1+3SUM2MeO x3kifQkhzANKStDHf8O5rfmIgzD609Dj86/TkFvbzEu3PvQQ3cReKdVYaCj+/TeSQBpx U5Lw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=P+bcVr75RecMOzOjHAeghgpkMsBPnl5cdswmzluAU/E=; fh=xJv+Klyytov3KGiQwAoOi4HC6j6hVaI+tOcmqPTIfBg=; b=wQQxLCwbQ4bQDIkOrzXlGyOzdE1gx+2c5kfQAbyR7TUXnT7Gt5yNxPsvut4G9m7dEX 2iPX+5BCkBr/6sUH9a8OUXBoM35n0paIQaOQXooIFjIKVWbRGWwrW/HXHXgQ2lSJgeF4 dR0FmTdxyS+3glnMFy2DphcsP70jZxEO5CyvU5+0qQbN7HqaYZy3dCME8xWVmTrVpeAi wiiNa0cxibtg+Y+poWiASAgGq636l0tIky9J4kj2stU+OBMCR7+KZx0chmK8X7OREv12 N9/PmJHrKJcjSqYQah5NmI4GxQgKaibgeWWgE6FZCRkw4v3Pagr13GN73vrDhLqgRuYj fo/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=ihgM8Sii; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id b21-20020a63cf55000000b00565db2812a0si8320975pgj.60.2023.10.16.10.06.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Oct 2023 10:06:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=ihgM8Sii; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id EE85A809C383; Mon, 16 Oct 2023 10:05:48 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234457AbjJPRFg (ORCPT + 99 others); Mon, 16 Oct 2023 13:05:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41114 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234485AbjJPRFT (ORCPT ); Mon, 16 Oct 2023 13:05:19 -0400 Received: from mail-lj1-x235.google.com (mail-lj1-x235.google.com [IPv6:2a00:1450:4864:20::235]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3E1742611 for ; Mon, 16 Oct 2023 10:01:35 -0700 (PDT) Received: by mail-lj1-x235.google.com with SMTP id 38308e7fff4ca-2c50ec238aeso34663281fa.0 for ; Mon, 16 Oct 2023 10:01:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697475693; x=1698080493; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=P+bcVr75RecMOzOjHAeghgpkMsBPnl5cdswmzluAU/E=; b=ihgM8Sii+FJvIXHTcnO6WJTwkZLmtOLmZnT5GwxyaLL31gmEfL+KqSkRqz2HD/geXE J8gEc3vxLv0hnXEJfIK/owUP4aW9aLqnMZ5LO+1EhL7tBk5c5iAELbNpLAvxv31Pp3aX ohy+d13p+hTepRgLUx+hRm7MLTKpq+xtK0PmNvOnapKoZjA69J6uUKzzxpcHlUexVOO8 dNIx+4zaDDUTqlsHR0wogRc2C0EVICTSWYif25SxeHzn3Ph0Mhd/OZhyB/Kyj07ZEUVj /ubrib79p2unbAuDrxQ+zGtRzMB7pzOkJ6Y1rQN252sbqRkWTniW9DjsuSD5wz+ZL62j S+Jg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697475693; x=1698080493; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=P+bcVr75RecMOzOjHAeghgpkMsBPnl5cdswmzluAU/E=; b=Vk9ZvrFQ4vBuHOu3zCbgoIeCqHj6cWVep4CtOcvq5YdHzM+0B/PsnJmgR43msgrB0Y Ttwu95o21vrdLuG0HShOkWznJjNJThkIJBbkBEdLU46ud8cYzjLqG71tLDLyseuX+v4Q IEiB4yB0xw11CqBn3etSCVxwUjSOKk6uUNwZfskS2J4B2lrnCXyCy/CwWzZTUHSeuJFD s5hS193HKT6Ybnjxq6VsY7LbRIWiCfR5P9V58NJ+ELz2GAXW13ZfkNV9YEl1gd6QgAW4 12cAP9EBCqjiUnW9mQJN+aBpEHtDfd6DguNrphVdpxzqW1H10iLtHbqnbGnJsjZY+C0o FAMw== X-Gm-Message-State: AOJu0YyZ1WtmF/Re0Ietc5fr5OzYoD0YQH7dPX+lOMU5V0RGAs+wJ09W NtXzgeRGH9mSjJ15SXkZv+StW0+unaHgWw/LhAaZGADo2zNXgdF4 X-Received: by 2002:a2e:b535:0:b0:2c5:1900:47a4 with SMTP id z21-20020a2eb535000000b002c5190047a4mr3643180ljm.0.1697475693138; Mon, 16 Oct 2023 10:01:33 -0700 (PDT) MIME-Version: 1.0 References: <20231016154900.3094-1-iulia.tanasescu@nxp.com> <20231016154900.3094-2-iulia.tanasescu@nxp.com> In-Reply-To: <20231016154900.3094-2-iulia.tanasescu@nxp.com> From: Luiz Augusto von Dentz Date: Mon, 16 Oct 2023 10:00:47 -0700 Message-ID: Subject: Re: [PATCH BlueZ 1/4] btio: Handle closed channel in server_cb To: Iulia Tanasescu Cc: linux-bluetooth@vger.kernel.org, claudia.rosu@nxp.com, mihai-octavian.urzica@nxp.com, silviu.barbulescu@nxp.com, vlad.pruteanu@nxp.com, andrei.istodorescu@nxp.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Mon, 16 Oct 2023 10:05:49 -0700 (PDT) Hi Iulia, On Mon, Oct 16, 2023 at 8:49=E2=80=AFAM Iulia Tanasescu 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, GIOConditio= n 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 =3D g_io_channel_unix_get_fd(io); > -- > 2.39.2 > --=20 Luiz Augusto von Dentz