Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp381767yba; Thu, 16 May 2019 02:22:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqxxv+UuyqNo+g25i7u0W9J1/m3yuyElvRW7RkP8jt+Lke15+P2l6xL/T4OJvRloFLmx9VI2 X-Received: by 2002:aa7:9e9a:: with SMTP id p26mr21024221pfq.176.1557998545275; Thu, 16 May 2019 02:22:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557998545; cv=none; d=google.com; s=arc-20160816; b=EPrSh4zz9ckzRFvML72fgSAeO7/5ARNVMe84sPQN/tIhW4rX38xxunbQ41h597sMRp KMokYsUVYpFuTf3nLABH/TqD8K7wljU7EXejJiZwb4Ccpn9S9ELTUYgxsOuqKiyf31QQ WyJIAWXcMLe0MReil0j1CcRtKsDAdcevgGD/viZ9ScGv5U44dW5kGFh+WP9BYRRkWCne BsevAnXKyGoBR2XAKg+45sJitiYJuOAjblzGz50wnx+X56ZT5W1GErZUtly8SFbRcfWM Rrn06rNUn7ga4PLDe6YC0xysbc8URzpNzBnrA7cx47R/YVJt4agjLKjLpXKgNZQa11ns 6Ljw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=KBe6Bd75hgYKIIS+cI8XUwTfG6WdHzi6hJxnk4W/FtI=; b=s+6qH35QxVUGYdXCS9Li2vkusahhMmQ5laNY92Lp2onJTBYg5s0hGyCLboZSosx707 re7G7f5KgMGmmcaP65PTrODSrgAeIQQERSeR4/Xv6x6FoZv8EJ1y/uBK7h4sUI+Hyw0O UKlxpPw4nGL1J3SmkJm7IfrhATBFg+dgeQsUvdsCgYrRpQ3wqv6K/GkX4w5H1m8o6dXl e3WowiB4l3tXBfD1sDnp9nIni1F3pFqsEsbup+l8+RZOHpygDpQ7OwtxVACV/Cu2ZBho iG25y5Tg5qK52pVeZ0ow0zQ11zhu4BS3jsYrobzrH92jtwB355ofsg4hdoWm7Hnr8pN6 AZtA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v13si4283574plo.429.2019.05.16.02.21.57; Thu, 16 May 2019 02:22:25 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726687AbfEPJVd (ORCPT + 99 others); Thu, 16 May 2019 05:21:33 -0400 Received: from atl4mhob11.registeredsite.com ([209.17.115.49]:37734 "EHLO atl4mhob11.registeredsite.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726336AbfEPJVd (ORCPT ); Thu, 16 May 2019 05:21:33 -0400 Received: from mailpod.hostingplatform.com (atl4qobmail02pod5.registeredsite.com [10.30.71.85]) by atl4mhob11.registeredsite.com (8.14.4/8.14.4) with ESMTP id x4G9LVjs014802 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Thu, 16 May 2019 05:21:31 -0400 Received: (qmail 31770 invoked by uid 0); 16 May 2019 09:21:31 -0000 X-TCPREMOTEIP: 208.85.15.155 X-Authenticated-UID: sbrown@opensat.com Received: from unknown (HELO 155-15-85-208.altiusbb.net) (sbrown@opensat.com@208.85.15.155) by 0 with ESMTPA; 16 May 2019 09:21:31 -0000 Received: from localhost (localhost [127.0.0.1]) by 155-15-85-208.altiusbb.net (Postfix) with ESMTP id 2CA0A1541093; Thu, 16 May 2019 05:21:30 -0400 (EDT) X-Virus-Scanned: Debian amavisd-new at ewol.com X-Spam-Flag: NO X-Spam-Score: -2.9 X-Spam-Level: X-Spam-Status: No, score=-2.9 tagged_above=-999 required=6.31 tests=[ALL_TRUSTED=-1, BAYES_00=-1.9] autolearn=ham autolearn_force=no Received: from 155-15-85-208.altiusbb.net ([127.0.0.1]) by localhost (fl-server.ewol.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id dycpzWWeIuxH; Thu, 16 May 2019 05:21:28 -0400 (EDT) Received: from z230 (z230.lan [192.168.1.3]) by 155-15-85-208.altiusbb.net (Postfix) with ESMTP id 4FC1D154107F; Thu, 16 May 2019 05:21:28 -0400 (EDT) Received: by z230 (Postfix, from userid 1000) id 3E520454013B; Thu, 16 May 2019 05:21:28 -0400 (EDT) From: Steve Brown To: linux-bluetooth@vger.kernel.org Cc: luiz.dentz@gmail.com, Steve Brown Subject: [PATCH] meshctl: Retry recvmsg if data is not ready, else return error Date: Thu, 16 May 2019 05:20:39 -0400 Message-Id: <20190516092039.8655-1-sbrown@ewol.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org --- 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