Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp166307ybi; Fri, 24 May 2019 01:50:55 -0700 (PDT) X-Google-Smtp-Source: APXvYqyEjDuaTMuMMrrMd5qW5vbam+/xWp4Prh6T2kCA2dfR4SDCn8tYxcCBBl4Bmq9P6FRjVB5G X-Received: by 2002:a17:90b:d8c:: with SMTP id bg12mr7425412pjb.63.1558687855709; Fri, 24 May 2019 01:50:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558687855; cv=none; d=google.com; s=arc-20160816; b=walgfRq8jF4c6CSBK8d5mel1rAJGyh0wZQX1X8n2RUxxpGQ1kMzeRv+kZSE5rgSLuF ETfk57EOdigC86Mzw3sPTpF0K+wwl03tm1K73sS3/OvqkgeUXQnZLGMEcmge5Q+2jDdT lG45/y96hKYOEbeRIYp6VTHuBaUPqRbH9LDMSs7SV2GncpTlA7wqVMq62+Wa7a+8cX9y Hd4upvj51B+DQcLHU3bIJCLiE/K+b6Pck4x0gax8I2gBA3hiRFg7AKrKBcCi65QyfhSN 6Dm7INQlKPqXptcOWi45gRuxU/knn9tKOXo6EKC4vk8JwzwiAhO9B0M6ShxuWRUCR05Z biIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=YTvIhWgfosdc65HgmaQhEWS8RJB+R+ySpDXKa0g/H98=; b=02zyX9P6hP7E+40x161ecpeEWgcE9CxaXsbyaRmaR6oazezZluHsz9ejGhSytHWY4Q dSAJhVHzum9M2IEIhdYsS9ZJrW26HTqWKldwHIc5HOMexI2DkoX8IqSYoCxZdV0zviwr /w1+xWl615Ld7iEHBWkW9+/pOAe2To/8/q78jugQbLdnFHe0A7XphjCQXAJs7l/BGeKo M4KVkG6QesotH5Hj23NbfUfkvH6y0X5QxZihnqhftest5kSR0mfBPqu2SZMoL86KhhXv ZyOX5e2YEeJCkWOUaAlnpumun58RHia+JI2F+GDHZlbbI+SJvGyCVgbQZA8MhRRcjgpp wV7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="m/QhEpcg"; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 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 vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h65si2814453pje.26.2019.05.24.01.50.23; Fri, 24 May 2019 01:50:55 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="m/QhEpcg"; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389509AbfEXIuR (ORCPT + 99 others); Fri, 24 May 2019 04:50:17 -0400 Received: from mail-ot1-f67.google.com ([209.85.210.67]:44869 "EHLO mail-ot1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389488AbfEXIuQ (ORCPT ); Fri, 24 May 2019 04:50:16 -0400 Received: by mail-ot1-f67.google.com with SMTP id g18so7978477otj.11 for ; Fri, 24 May 2019 01:50:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=YTvIhWgfosdc65HgmaQhEWS8RJB+R+ySpDXKa0g/H98=; b=m/QhEpcguK4EDDPXehbAPHDoHjzYCr8dOEdxnRENnZwnAR5faZgzluzPb2fGJp0067 q0W2Tl3IMHzHUsWq6eYpVDjH9sxpaJHYSbYnx9i+6kdVNvyJI9RVX/AMmtwH3Qz/z2xe QGSwpff4HnkcepepX3286OEla9Vp7kjeZK3LwTg/y/TzU7qOmOfz0ODfP9tVc3aMzSgv k7D0JjjVz1OS9Uw7iYQ8LZbsHPOX4rT1YiG33fjfqmCkvR8LMQb3nHOTWavyrqC4rr0R 1LgAJgRRtRn4jqnOs8HktJtZX4WoXLSjWVY3RrNcwg+nyffh3G+YhguFE5ous5NsMoVa ebpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=YTvIhWgfosdc65HgmaQhEWS8RJB+R+ySpDXKa0g/H98=; b=Ssbm7fQ5S8KptqqWOKju2GrgCCCuWacTTB5BQjKIEElQ29dYSC3kM0u5C1FZC1/8Er daiJ5kWIggil2pD27Z4MV5vStnHg4d04Z7D8fRWNKFx2CmcP9zzg07YVVndAZo+o2dLy BvpCII8DicbsoolhuGtAMYu6v4h3fkzKH6+L8/zyOom38cyyDy2bbu+wowhoFK/r9L78 U8Uo/5BpaXHZBSpfcqSYMiTRA2GwidfZ9A48cwLLR/qDv/OXHN6FDX2c6ZaUn52U2RgZ /i4jPAu0Rqz07faAwlcjyphAIBQ6D+jfSEg/aek5+yqHfDQP6yxQkcOo64XG7xw7Ib2V +BMA== X-Gm-Message-State: APjAAAUWtlDuJwrtMu6MyIxzC6I9Cumw6NM5Kf5kfHDZJgej12DLU2wV /5wyg6EceH9rzqsRc1dV05/Th24/SmJu9MeHK4Jzst/Rw58= X-Received: by 2002:a9d:6288:: with SMTP id x8mr34045682otk.79.1558687816004; Fri, 24 May 2019 01:50:16 -0700 (PDT) MIME-Version: 1.0 References: <20190521200313.11487-1-sbrown@ewol.com> In-Reply-To: <20190521200313.11487-1-sbrown@ewol.com> From: Luiz Augusto von Dentz Date: Fri, 24 May 2019 11:50:03 +0300 Message-ID: Subject: Re: [PATCH v2] meshctl: Retry recvmsg if data is not ready To: Steve Brown Cc: "linux-bluetooth@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Hi Steve, On Tue, May 21, 2019 at 11:29 PM Steve Brown wrote: > > Commit d6eec1b67d6d ("meshctl: Switch from write to sendmsg for Acquire*") > causes a regression by returning an error if recvmsg has no data available. > Fix it by retrying until data is received. > --- > Changes in v2: > * Reword commit message > tools/mesh/gatt.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/tools/mesh/gatt.c b/tools/mesh/gatt.c > index 2269a20cf..0a942d4eb 100644 > --- a/tools/mesh/gatt.c > +++ b/tools/mesh/gatt.c > @@ -415,8 +415,11 @@ static bool sock_read(struct io *io, bool prov, void *user_data) > msg.msg_iovlen = 1; > > while ((len = recvmsg(fd, &msg, MSG_DONTWAIT))) { > - if (len <= 0) > + if (len <= 0) { > + if (errno == EAGAIN) > + break; > return false; > + } > > res = buf; > len_sar = mesh_gatt_sar(&res, len); > -- > 2.20.1 Applied, thanks. -- Luiz Augusto von Dentz