Message ID | 20220308174404.1017582-3-sbabic@denx.de |
---|---|
State | Accepted |
Headers | show
Return-Path: <swupdate+bncBCXPLOXJ6IKRB3NLT2IQMGQEI4D4R5I@googlegroups.com> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=googlegroups.com header.i=@googlegroups.com header.a=rsa-sha256 header.s=20210112 header.b=Na06b5N5; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=googlegroups.com (client-ip=2a00:1450:4864:20::437; helo=mail-wr1-x437.google.com; envelope-from=swupdate+bncbcxploxj6ikrb3nlt2iqmgqei4d4r5i@googlegroups.com; receiver=<UNKNOWN>) Received: from mail-wr1-x437.google.com (mail-wr1-x437.google.com [IPv6:2a00:1450:4864:20::437]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4KCjPY5YCcz9sGF for <incoming@patchwork.ozlabs.org>; Wed, 9 Mar 2022 04:44:16 +1100 (AEDT) Received: by mail-wr1-x437.google.com with SMTP id z16-20020adff1d0000000b001ef7dc78b23sf5696555wro.12 for <incoming@patchwork.ozlabs.org>; Tue, 08 Mar 2022 09:44:16 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1646761453; cv=pass; d=google.com; s=arc-20160816; b=K4ZJY+tmT6xRBs5mCMyca/aeh4JM+VaNSCPd78OnApBKiSrAZtmKLHwRXM0JDyRIJl DA3QWrOrRUrcdRxrGRFnu9TnFsyNlblWHcaVOlPU5caIpTFkHP+qUL6db24oDeQgXzSC dEjo8E/NMlBXcIlJVpmtgfbnjzEqM4T3gcTWSXTWaNtrgqg5W7QsIOIm3tA34F7OFjg9 5cERiyPHbPNpFpuyNwmIFzJiY1RWBdgOwdwye04gRd/9EEaN7w6zJHSlJwRi8Ru1WrGa HQmRb8+otzKhdoPU4isIBBQg3jYLeq9LR68bbMglgkN3w4CPbhQDjox+BLo9Pcmx5J6M yNUA== 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:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:dkim-signature; bh=92BDYzyoO1WJrKheOVD7rwDCkQlH3BVxfOydkommxIw=; b=wDCaUXiAylDcne5WYA1M6WuDdnMQaDfD7qpAcL/3JhK2/7gPlpGa5yFD7/cIL6htsc eavx23JlCRrU+xGVWxYpsIczaQp6ZaWH4WvMN+6kGZR6fbN2IrNFBC8rNxHh6QWBUIEk fDGgs5cCc5rfOXWV7zsdClRWyuPvY26lMss9A14rna46LKI53AERonBmi84ycggvBvAk HGUThUgMEvlv6m+0ATkG7gI2NT2EKi9Qzug9F+JbvwvhAGip/6URc2+waaCYXab2b0YA todnhtRmPMawqXxv51zpTuDrbKlMzL2qqEDzFwi9F4SYUl2h8XCwmle2BG0xKc4oUCQy I42w== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=neutral (google.com: 212.18.0.9 is neither permitted nor denied by domain of sbabic@denx.de) smtp.mailfrom=sbabic@denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=92BDYzyoO1WJrKheOVD7rwDCkQlH3BVxfOydkommxIw=; b=Na06b5N5+km3MQkdoqpR9ZnQkWTyQoMRWBI3sX29mG27QMsLIuq4w/G8t1y0kRaUUw xSBBFXesJgxt51WZasCWLSFhmjytCBEgVt6NTd5UGYfXm07Tt9TFFhXdoRqqMI/bpUgu saOnRsXb3bNzZ34dRDD7xY95tFmvVtHbci6CtGC5oMDS1py3YBI+FLinG2X9pN14Xa36 iXR0x4DuO5+Vp1b3mgboxiVnI/iornGEAicfcWRI5zLksKPiXBZMrBVB0wWp+cNSkxwW WmxNk6qah2/3pdVdTyf8eU0ZjO+f/tSn8w+EXgFrD6cY4Zg0y0KqxrRVCB0xCGwlWdmA woWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=sender:x-gm-message-state:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version: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=92BDYzyoO1WJrKheOVD7rwDCkQlH3BVxfOydkommxIw=; b=sPXe16SUwV4ZVmVtMYPK4KfvgDE00M3RTTOViZ9Wbu8tU1r7wxEormABzHIP5gikSc wfnV2M4SQX3+vrBqBSclgmKu+e/y4dlj44awJoVu+QHu3a0eFG/FpyR3O8cIDody5dFF Ko3petp1aIqEjyyyFqLbYZ2FmnN8X/5NQaPenJPHJ02Kv9MdRMyoZG/BmS+gWFoTyz6P r6LIuPy1pozHbqdq4ypj3NyliMGA9PCMZjVAuywY1PcbvO6+OmAcQF8RyDyfw66OGZJN CLtb1Bg3eOvoAWrEXwcmGSA4lCyIGMaV1/rsg97b4ex0+Il2qy2YIFTq2APmIOQgg0v1 LHhA== Sender: swupdate@googlegroups.com X-Gm-Message-State: AOAM532xBYfiCi1Asmip6TUgMdrNkxIKm+IfwN0tivU2ILOC86v8jINX fCmrA7GwA4a606JgFtxHw6M= X-Google-Smtp-Source: ABdhPJz718Ilb2Ko7KsGlsY8SpmuOzlrEfkLzibFY3zhA2PRdzwOOYF3PeIVG41ludn5jzWmxcXuGg== X-Received: by 2002:a05:600c:154e:b0:381:81d1:8e78 with SMTP id f14-20020a05600c154e00b0038181d18e78mr4622581wmg.51.1646761453613; Tue, 08 Mar 2022 09:44:13 -0800 (PST) X-BeenThere: swupdate@googlegroups.com Received: by 2002:a1c:2747:0:b0:381:80e8:be59 with SMTP id n68-20020a1c2747000000b0038180e8be59ls1585724wmn.1.gmail; Tue, 08 Mar 2022 09:44:12 -0800 (PST) X-Received: by 2002:a1c:f018:0:b0:37b:c13c:3128 with SMTP id a24-20020a1cf018000000b0037bc13c3128mr4500899wmb.157.1646761452339; Tue, 08 Mar 2022 09:44:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646761452; cv=none; d=google.com; s=arc-20160816; b=ul8jUYWSdblc5TqVuPtbiTu4j3HjFLYbAQQrMSvXO2fXyH78h023bfpDQWtc4sfN8Y ib9MmhKCpMtcf+WQzrsQtHqIuMTzFGSDui28RmDaQdxtgz3snYRlpfDQ9/uC7LkS283K 07eqAT3jQUhUgGOkq7RZ253jnQI1hTWJt7tWslBtHrG6v5kT4X1MBrEEbkKX9UjleMe7 8LuJ3xvAAkWIoSQUJdrtJj2WawKGfsoYE6zoaYIkut4y4RbYRtFdZGBVM9wmTZ0DnVwj d5H1ZkdpdkbqdlpSSnhkkzEly2DDOwmb73uUjCLLynv7wJpgoHbN+VKA9/HRFG/DDi8i yRnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=tKytKFreaGlXAbCW8UAaHJXlwaw0Y0UxIF/jYSai6lY=; b=KEuJrOqG1w+aXPPlnJKj6GDJ0nQ+RQYDk7lnEs0GM6u4S8e4Nr7YauR87DoJheU/RU xPyPrmWPj0SsEGgjOytyquChw/ap5LfRz56YBYRURwGeNpJ3OCG8UjFeeUBWg+nEnCxs OQ9+cVEnEt7+kYUVyh5ua4VoU7Kvg2vjG169hog28YFYruedmHLJpcUK1khRTvll0cag xdcuV17jv5Iu18FYc2aiBKJXKvOr0M0gTmH9l3yrUtQA8dJI2B36uhdM2gUIZae9Ktcc XMFVlqlc34lf0g99nODfe8I+0Wx3u5F82FtiWSX0QfYzlq1tKXqSpYx4QepWSVt4QQR2 ed0w== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=neutral (google.com: 212.18.0.9 is neither permitted nor denied by domain of sbabic@denx.de) smtp.mailfrom=sbabic@denx.de Received: from mail-out.m-online.net (mail-out.m-online.net. [212.18.0.9]) by gmr-mx.google.com with ESMTPS id y5-20020a05600015c500b001f1e6db5342si363296wry.3.2022.03.08.09.44.12 for <swupdate@googlegroups.com> (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 08 Mar 2022 09:44:12 -0800 (PST) Received-SPF: neutral (google.com: 212.18.0.9 is neither permitted nor denied by domain of sbabic@denx.de) client-ip=212.18.0.9; Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 4KCjPS0mKlz1r0P9; Tue, 8 Mar 2022 18:44:12 +0100 (CET) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 4KCjPS0Yrsz1qqkB; Tue, 8 Mar 2022 18:44:12 +0100 (CET) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id GjNKQkQGwDsV; Tue, 8 Mar 2022 18:44:11 +0100 (CET) Received: from babic.homelinux.org (host-88-217-136-221.customer.m-online.net [88.217.136.221]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPS; Tue, 8 Mar 2022 18:44:11 +0100 (CET) Received: from localhost (mail.babic.homelinux.org [127.0.0.1]) by babic.homelinux.org (Postfix) with ESMTP id 1AC1B4540972; Tue, 8 Mar 2022 18:44:11 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at babic.homelinux.org Received: from babic.homelinux.org ([IPv6:::1]) by localhost (mail.babic.homelinux.org [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id QImwEQJyWhBu; Tue, 8 Mar 2022 18:44:08 +0100 (CET) Received: from paperino.fritz.box (paperino.fritz.box [192.168.178.48]) by babic.homelinux.org (Postfix) with ESMTP id 5AC4C4541ECA; Tue, 8 Mar 2022 18:44:06 +0100 (CET) From: Stefano Babic <sbabic@denx.de> To: swupdate@googlegroups.com Cc: Stefano Babic <sbabic@denx.de> Subject: [swupdate] [PATCH V2 3/4] BUG: IPC: ipc_send_data checks data is sent Date: Tue, 8 Mar 2022 18:44:03 +0100 Message-Id: <20220308174404.1017582-3-sbabic@denx.de> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220308174404.1017582-1-sbabic@denx.de> References: <20220308174404.1017582-1-sbabic@denx.de> MIME-Version: 1.0 X-Original-Sender: sbabic@denx.de X-Original-Authentication-Results: gmr-mx.google.com; spf=neutral (google.com: 212.18.0.9 is neither permitted nor denied by domain of sbabic@denx.de) smtp.mailfrom=sbabic@denx.de Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list swupdate@googlegroups.com; contact swupdate+owners@googlegroups.com List-ID: <swupdate.googlegroups.com> X-Spam-Checked-In-Group: swupdate@googlegroups.com X-Google-Group-Id: 605343134186 List-Post: <https://groups.google.com/group/swupdate/post>, <mailto:swupdate@googlegroups.com> List-Help: <https://groups.google.com/support/>, <mailto:swupdate+help@googlegroups.com> List-Archive: <https://groups.google.com/group/swupdate List-Subscribe: <https://groups.google.com/group/swupdate/subscribe>, <mailto:swupdate+subscribe@googlegroups.com> List-Unsubscribe: <mailto:googlegroups-manage+605343134186+unsubscribe@googlegroups.com>, <https://groups.google.com/group/swupdate/subscribe> |
Series |
[V2,1/4] Revert "ipc_notify_receive: add timeout_ms argument"
|
expand
|
diff --git a/ipc/network_ipc.c b/ipc/network_ipc.c index eb1082c..6c8c03a 100644 --- a/ipc/network_ipc.c +++ b/ipc/network_ipc.c @@ -310,8 +310,18 @@ int ipc_inst_start(void) */ int ipc_send_data(int connfd, char *buf, int size) { - ssize_t ret = write(connfd, buf, (size_t)size); - return ret != size ? -1 : (int)ret; + ssize_t ret; + ssize_t len = size; + + while (len) { + ret = write(connfd, buf, (size_t)size); + if (ret < 0) + return ret; + len -= ret; + buf += ret; + } + + return size; } void ipc_end(int connfd)
write() returns the number of written data, loops until all data is writte or an error occurs. Signed-off-by: Stefano Babic <sbabic@denx.de> --- Changes since V1: - pointer to buffer must be moved after successful send ipc/network_ipc.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-)