From patchwork Mon Jan 8 10:48:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Herbrechtsmeier X-Patchwork-Id: 856762 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=googlegroups.com (client-ip=2a00:1450:400c:c0c::23c; helo=mail-wr0-x23c.google.com; envelope-from=swupdate+bncbdn7dbh5yqibbhmzzxjakgqevjl2h4i@googlegroups.com; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=googlegroups.com header.i=@googlegroups.com header.b="WQNysi9s"; dkim-atps=neutral Received: from mail-wr0-x23c.google.com (mail-wr0-x23c.google.com [IPv6:2a00:1450:400c:c0c::23c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zFX801TSSz9rxj for ; Mon, 8 Jan 2018 21:49:04 +1100 (AEDT) Received: by mail-wr0-x23c.google.com with SMTP id s105sf6646211wrc.23 for ; Mon, 08 Jan 2018 02:49:03 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1515408541; cv=pass; d=google.com; s=arc-20160816; b=P9V9ztvQlBr7Y7qi/R5BsUNok24pNFePSf9xrg26oBaT9agh71eN4iAzcuVHMl7S7j H5/OwhSuhHdXhySd60gKAhqvosgOes7pnsvHgVUI7LEk8DnZMQdXcj/Oei2FWOU3V8wm 5AHpCZk42pHAA83MkV/xw0fnxEbdkfq98m1rt8cQaNyS71umn0KTpaoglAlvvFE0Eda5 nKFmmb184zpxHec2sIVd46fr9MIDXi25l3MdfhQyv8VRgLrqeRb2686W+RKZXTLQkW9K Yc0tAXrxwaOxvaYqqJP/BU4hCmPyT3HK6pQFTcVNbKDpYLoHXMVh5JYo1dduGALbaFi2 CrNw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:message-id:date:subject:cc:to:from :arc-authentication-results:arc-message-signature:mime-version :sender:dkim-signature:arc-authentication-results; bh=phQf2Ds8dGPg1T63Ljt9SW/htDRXCBBESeaz6bHrwuY=; b=HWe6oKKyduPH5vx+Kw2/47SkSrDHSQJhPyYai8EpDR/xeGU05+Jl9uYX+ckzIB15V4 RT3tggrGdo0xwVLvDt9M1n6gwW8bHAH45rlcFCHK8atT8S6f1ESlE3rroSJ1rUhgksu6 Cw362a5pwJOpdPAx2KkRSyX8ylYZY0HbTtvAKOA9FgSlNpW7SVwvmH0IRhUy+kNrEH32 M85i4Abon03fuggy9HwBakHLqj3BnSTPFs6x0vGdZNDYGM0ovMHE4y5Q7ysT/WsUY8iP qeecUcs05mvAsEO+V4rSd0vH36bMHT2h4JfzOFkmClqqqNrh8OJaYM7PnFFedJWbD7ti WDig== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=neutral (google.com: 85.13.157.12 is neither permitted nor denied by best guess record for domain of stefan@herbrechtsmeier.net) smtp.mailfrom=stefan@herbrechtsmeier.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:mime-version:from:to:cc:subject:date:message-id :x-original-sender:x-original-authentication-results:precedence :mailing-list:list-id:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=phQf2Ds8dGPg1T63Ljt9SW/htDRXCBBESeaz6bHrwuY=; b=WQNysi9sLSlZZFM9JFOrpSagAJ/CzgOBTaFUAa+n6XSCnQgr15ZzRfV2/rjrlZqutx K495x6ywVDPwq6FpaVy6x05Wy0ZYE0DGyC4+2/WEPwNSXabJ/B3KtPs6iWlSxj+Z6yXk gnMJSNLqnlqJF5am5fW0+VW+w4HVYLKy7BTe14jDF99fQDM5M5bEQJYgzB9x1/AMqbku kge5CBWCaKWqM8jJsHFQqKZpqO8Sd4a4eSbNJYdqyAlQlTA9oPtpga05hg9eYHTMEqFe r93c2kI7g/Q2F1JRRzfMynZWotI3jJRSIIqAqQoRkFEOgo7RnPXRH6jbj1RcwVjye3o6 Upew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:mime-version:from:to:cc:subject:date :message-id:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:x-spam-checked-in-group:list-post :list-help:list-archive:list-subscribe:list-unsubscribe; bh=phQf2Ds8dGPg1T63Ljt9SW/htDRXCBBESeaz6bHrwuY=; b=an7dD8p5bjIhLMegt15eWdfCtSxhu0NHJV/g/TK4xEivM/nMNgyuebvkBuS/KjvYnQ S2wwZshZVWI1yY9iKF2pLtmYLUetDmpHwB0CXAriu4wY7DXlIO5ylgdkg48UO8Db+Gmb 1ASpo3BTr9hnWtdrPbM54pcMnNa1HM0w8laNaQqNkDIe+ctMFx41IAROvb5kgW3MhazA DlN8bOGeFo/Uq2ZODyjvrkfYO0jrpzhsxey1IiZJNNWxLqoFHVDuxjVF5baL2JeaFlrU kpeBbUCEJK3pvue2lfEWs8tlCR8N2OqT5JVsZadGzARQhSpCn4T4SYD12ezGcbKy2Qg0 CVVQ== Sender: swupdate@googlegroups.com X-Gm-Message-State: AKGB3mJWurM2tjKe2/ODaSF+eG7rHRcBrRT8V8suv+njwRHq0TMkDKg8 4cSqBHYwbkCCGohWR8oveDg= X-Google-Smtp-Source: ACJfBotHV/WAaDAmwb8biYyyTtj/T9fXb//xPt2mJmU0iQ9TSezGjIni9aOzAyFikfkPJPZ+ogwhHw== X-Received: by 10.28.167.22 with SMTP id q22mr121949wme.7.1515408541596; Mon, 08 Jan 2018 02:49:01 -0800 (PST) MIME-Version: 1.0 X-BeenThere: swupdate@googlegroups.com Received: by 10.80.165.3 with SMTP id y3ls25654edb.4.gmail; Mon, 08 Jan 2018 02:49:01 -0800 (PST) X-Received: by 10.80.146.230 with SMTP id l35mr3420851eda.1.1515408541117; Mon, 08 Jan 2018 02:49:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515408541; cv=none; d=google.com; s=arc-20160816; b=svJ5h4NTAGMES16gBz9iX0rxXrGMDwmUkbcs7dySG7FbZ4OSANvP30e4rv2sNyOUsr fj27ID3yOgAqbJucjmLewp3DhAEjTuiirsaXpeDGEKhEyxCwbBJ3ORUdZzFdwHqH0CgC z3upEuJujp+3pgPe2t0JGg0+oiCEoy7qJA968o/ZcwSJYZ2c9n40zQkEM9VL3NUgBk4E quYBQ6cwMgHAyAr6BoTPBABjS167aTNCbievDibXC10KggqKvdnwXFHmZHkhw44WznU+ twPNdgRNY0ypmaytWjFKW1AztionhnJst3O65v8uYLa3j9kwvsvHhWjlxdxyJ+9sd1Il zrcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:subject:cc:to:from:arc-authentication-results; bh=ZcIo7yBl07PtVRuTBjpellA8T2bk4I1PEpsiCiu582g=; b=HgYD4Us1+zIrTv/YP2XGmbm8Iji9l4cbPsFje9ShTqEG72lEbTboloyfh7PRRC9llA 0jV10wi+C5OxupIWEc7e3piSBvSsdrWgJYSaOeUoq9mlsLCifOpec1hGeCXOJeDqEqYE /7KeXUp3ebH2iOJjFvqLGbB5eXkIhUZyF5kAiSK9sA3b2R+L9SGTMUQ5U3z2IdAXXBm7 zh6214IgU5Ff74C5oBEykeTLOUGR5dZdjpc3zuK3E4c6zxyL0H02m8VFp/20TijTur+6 jep0LG0Oe8TFN5kkjPoct300c+U6YmaYbXt4fjYkuvDhM5vf9+xy0f7FmJ+WhqkYmvjh TdLA== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=neutral (google.com: 85.13.157.12 is neither permitted nor denied by best guess record for domain of stefan@herbrechtsmeier.net) smtp.mailfrom=stefan@herbrechtsmeier.net Received: from dd41138.kasserver.com (dd41138.kasserver.com. [85.13.157.12]) by gmr-mx.google.com with ESMTPS id r58si1756232eda.3.2018.01.08.02.49.01 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 08 Jan 2018 02:49:01 -0800 (PST) Received-SPF: neutral (google.com: 85.13.157.12 is neither permitted nor denied by best guess record for domain of stefan@herbrechtsmeier.net) client-ip=85.13.157.12; Received: from WS08941.weidmueller.com (unknown [217.244.7.16]) by dd41138.kasserver.com (Postfix) with ESMTPSA id 7254611A00D0; Mon, 8 Jan 2018 11:49:00 +0100 (CET) From: stefan@herbrechtsmeier.net To: swupdate@googlegroups.com Cc: Stefan Herbrechtsmeier Subject: [swupdate] [PATCH 1/3] progress_ipc: Add non-blocking receive support Date: Mon, 8 Jan 2018 11:48:39 +0100 Message-Id: <1515408521-31480-1-git-send-email-stefan@herbrechtsmeier.net> X-Mailer: git-send-email 2.7.4 X-Original-Sender: stefan@herbrechtsmeier.net X-Original-Authentication-Results: gmr-mx.google.com; spf=neutral (google.com: 85.13.157.12 is neither permitted nor denied by best guess record for domain of stefan@herbrechtsmeier.net) smtp.mailfrom=stefan@herbrechtsmeier.net Precedence: list Mailing-list: list swupdate@googlegroups.com; contact swupdate+owners@googlegroups.com List-ID: X-Spam-Checked-In-Group: swupdate@googlegroups.com X-Google-Group-Id: 605343134186 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , From: Stefan Herbrechtsmeier Signed-off-by: Stefan Herbrechtsmeier --- ipc/progress_ipc.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ipc/progress_ipc.c b/ipc/progress_ipc.c index 881d2c7..ca60f67 100644 --- a/ipc/progress_ipc.c +++ b/ipc/progress_ipc.c @@ -19,6 +19,7 @@ #include #include +#include #include #include #include @@ -61,11 +62,16 @@ int progress_ipc_connect(bool reconnect) int progress_ipc_receive(int *connfd, struct progress_msg *msg) { int ret = read(*connfd, msg, sizeof(*msg)); + + if (ret == -1 && errno == EAGAIN) + return 0; + if (ret != sizeof(*msg)) { fprintf(stdout, "Connection closing..\n"); close(*connfd); *connfd = -1; return -1; } + return ret; }