Message ID | 1466401007-30322-1-git-send-email-eyal.birger@gmail.com |
---|---|
State | Changes Requested |
Headers | show
Return-Path: <openwrt-devel-bounces@lists.openwrt.org> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from arrakis.dune.hu (caladan.dune.hu [78.24.191.180]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3rY0444T9mz9ssP for <incoming@patchwork.ozlabs.org>; Mon, 20 Jun 2016 15:37:24 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=EYeTLNlq; dkim-atps=neutral Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id C4E7CB923CB; Mon, 20 Jun 2016 07:37:15 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on arrakis.dune.hu X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00,FREEMAIL_FROM, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.1 Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP; Mon, 20 Jun 2016 07:37:15 +0200 (CEST) Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 03D44B923C3 for <openwrt-devel@lists.openwrt.org>; Mon, 20 Jun 2016 07:37:14 +0200 (CEST) X-policyd-weight: using cached result; rate: -7 Received: from mail-wm0-f68.google.com (mail-wm0-f68.google.com [74.125.82.68]) by arrakis.dune.hu (Postfix) with ESMTPS for <openwrt-devel@lists.openwrt.org>; Mon, 20 Jun 2016 07:37:13 +0200 (CEST) Received: by mail-wm0-f68.google.com with SMTP id a66so6080177wme.2 for <openwrt-devel@lists.openwrt.org>; Sun, 19 Jun 2016 22:37:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=n81IZ8kvRuRes64KULT5WWWXVWA0/C88/PnrtNqQ+/c=; b=EYeTLNlqdBgtQDHpSn5EuGJhGGAHhv9f/lfwDQ1AZ1X/YH6qlnEMleYxKv5yKUbggz bxKGVyFVnbkPI+DlA1G7O6mF5Hqc9aozMoQVMBcv3rl41/Jfq9d788ep0gXnW81S2Eos oJZ+E2Kh7F8ubDX6UFHTm6PG9ofiWc3sclkCMpAKPGYf6gOhXyyhLG8dibvpfPj9n22S ypWbq+GpTIvRKuxYUHtDlLTunfHOUYg5A+iuprlQNVfT1h5fu0Jlf1j0++hhseBmmKhp zh+VnZDxJa1Qpg5o8cL16TwJwxTR6T5ro3bRYiyxL6EfIE1WyFS9x/AS8ZcslzANVw1/ G8wQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=n81IZ8kvRuRes64KULT5WWWXVWA0/C88/PnrtNqQ+/c=; b=ZnNn0UGpwtvsYvX544ovY3Z8IpQ4tIF2zPIzRwApc7qT9pc+Oh/VMKMu+qeuP9VkfO iwhII0ooqw0gnLErLJmxasCj3vka4KtgZmzShPS9JlsX1aBwC/f5YP6WtWx/FdYcZ193 rJ2s7PxorlkOTODmhWm2BuyXEqN8LoAd1+vTEVRe/YoNFTxrUZntQFiR/51uxVYFq6Ow 0jec1f/5wIwx0BnZBoJKYFsT1e7gTZW2rkSSsHLoFKtedWndzuJnJSwYS41LMiGdt18u 2IYPJcv+B+U9aLub0JyBiPOIz5k57urmmMImVTpe1QBnYd8WdadmzvVkoaIUUY9+LPCs SOHA== X-Gm-Message-State: ALyK8tKkm4R8Hp9yMvHPDeIrzEBGyPSfUjRqqO+TO7WWpCXEBnk6IUoYGsAlUeMHkX4o4Q== X-Received: by 10.28.66.148 with SMTP id k20mr9833473wmi.55.1466401028332; Sun, 19 Jun 2016 22:37:08 -0700 (PDT) Received: from netad9sh4952.netanya.eu.thmulti.com ([94.188.248.67]) by smtp.gmail.com with ESMTPSA id f196sm6410228wmg.15.2016.06.19.22.37.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 19 Jun 2016 22:37:07 -0700 (PDT) From: Eyal Birger <eyal.birger@gmail.com> To: openwrt-devel@lists.openwrt.org, lede-dev@lists.infradead.org Date: Mon, 20 Jun 2016 08:36:47 +0300 Message-Id: <1466401007-30322-1-git-send-email-eyal.birger@gmail.com> X-Mailer: git-send-email 1.9.1 Subject: [OpenWrt-Devel] [PATCH] uloop: handle waker pipe write() return value X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: OpenWrt Development List <openwrt-devel.lists.openwrt.org> List-Unsubscribe: <https://lists.openwrt.org/cgi-bin/mailman/options/openwrt-devel>, <mailto:openwrt-devel-request@lists.openwrt.org?subject=unsubscribe> List-Archive: <http://lists.openwrt.org/pipermail/openwrt-devel/> List-Post: <mailto:openwrt-devel@lists.openwrt.org> List-Help: <mailto:openwrt-devel-request@lists.openwrt.org?subject=help> List-Subscribe: <https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel>, <mailto:openwrt-devel-request@lists.openwrt.org?subject=subscribe> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Errors-To: openwrt-devel-bounces@lists.openwrt.org Sender: "openwrt-devel" <openwrt-devel-bounces@lists.openwrt.org> |
diff --git a/uloop.c b/uloop.c index e60fb09..fd315c0 100644 --- a/uloop.c +++ b/uloop.c @@ -386,7 +386,13 @@ static void uloop_handle_processes(void) static void uloop_signal_wake(void) { - write(waker_pipe, "w", 1); + do { + if (write(waker_pipe, "w", 1) < 0) { + if (errno == EINTR) + continue; + } + break; + } while (1); } static void uloop_handle_sigint(int signo)
Recent glibc warns if result of read() or write() is unused. Added a retry in case of EINTR, all other faults are silently discarded. Signed-off-by: Eyal Birger <eyal.birger@gmail.com> ----- - I was not able to reproduce the EINTR case, but it seems to be the right thing to do - Retrying on EAGAIN in this case would be weird as there is no one to read from the other end of the pipe. We could call waker_consume() directly but since the size of the message is just one byte, I think this would be dead code --- uloop.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)