From patchwork Mon Mar 19 13:34:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Storm, Christian" X-Patchwork-Id: 887710 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::239; helo=mail-wr0-x239.google.com; envelope-from=swupdate+bncbdd6bwv65qpbbyxyx3kqkgqef5jhrsa@googlegroups.com; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=siemens.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=googlegroups.com header.i=@googlegroups.com header.b="tPMaYF1r"; dkim-atps=neutral Received: from mail-wr0-x239.google.com (mail-wr0-x239.google.com [IPv6:2a00:1450:400c:c0c::239]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 404cVY55TFz9sWH for ; Tue, 20 Mar 2018 00:34:29 +1100 (AEDT) Received: by mail-wr0-x239.google.com with SMTP id 31sf1874736wrr.2 for ; Mon, 19 Mar 2018 06:34:29 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1521466467; cv=pass; d=google.com; s=arc-20160816; b=nYNCCOZtYWboW6LaEx/rQ9AaTiUB1dbzWu/kjRqZgL9bnpXaiNAyuf44M9Jm5dagl4 g9/S1Qrmd5uaI0FsKYTl6+KvLnZIpT3eSqgw0EeMgIZrGAE0/Mw7eIIRNXH1sxIk09lj V4jxWmsIXrVIUfHjqWvRw5OW8MnbxPCRNNhqVgisiwScXWS6Guj/yTfmcKFhQzbFTyV+ EjrTtNi/UM5S3pa7C8k4Jy/wAknWLz1q949elL/3Lg0fDAMuKyD0ci0uAdfngK2JyWKv J34tRY08u4g8Ht1mqqXXh1aq7frIZaoKXiCkrYOqG5wgOtrCaGRh8Hi5voCc9bLKuISC gYvA== 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=PLz193yXYB+ceagQYqRD3HvTTcLH9l3zEZIUuzUCbaE=; b=oooABc5PbMx5bFcXq3k6jCnsft99fmeixIum0Yjg8xv+UvQn1AjavdE6AzpHaV9JLe 1vsYWxyALMlaRr0Baw/5StsD/8xBqX0Lbw1tgZilqhvNOPxdM4r5+wko96VRl3zVUdaQ kCHXdQrnUH+x/REGTeDiyWNRdX2QtoLCDdI41U+XTeKE6lG4glwC633EsWTIc77jfD80 +B+jGJVQqD12FKG4LwSTxmn15/KDpkvrbarJFQwqh/hNm8RB3Vgc8T4aQoDexKelogXk 0BDsiGj9JauudIKVzb7xTliEv5YV89HWu2NwI6mrHkqMhd+3ag51lAEKqKbFQ5fYVqr2 vboQ== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=pass (google.com: domain of christian.storm@siemens.com designates 192.35.17.28 as permitted sender) smtp.mailfrom=christian.storm@siemens.com 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=PLz193yXYB+ceagQYqRD3HvTTcLH9l3zEZIUuzUCbaE=; b=tPMaYF1rU8q4NXcFpDE57rB4Jv3GKbx4enwcgZcCuPFqtMruDguFr56P6rn7yBJ1bP lrf5LGkM/6ExFo6Tmv8Ek82BycPnrscZ30ZwhN5YrRyLKdQwk5oCKPlZjQTKCfBGGIs3 fc5ztMyjWTNoulcKYtMKMuRq4j9uNA9UNKrJwGgrotCCajtY+S+dLrRWVZcruHUVCfHj GIsYtE/UwwAHZwxgQNbmb+bm9+rUIGWt7QUf4nA9Mb5SvqEShvJXxhCKxyMkQayP6vdF 7riROaNuZmePv7j1U8i7DEquT7buMWpbmRgZi+MFMZ8mEfyFxAOv/nmfJmUNWyrFHOG0 r1hA== 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=PLz193yXYB+ceagQYqRD3HvTTcLH9l3zEZIUuzUCbaE=; b=BjyzqD76YQkxq01Ola6RpupAIQBjcsIJI0EA1TAw+8Soan4C8EWuohDorTh4oDMLzH d6CJIOPePY0NNk6BR2ZeErU+AaBSvQWK49QTWDyBRaIZSi/c3+MIknxVCJVgVHZl8e+J w3Rj2SY63ZBRalMT5k2EcMHT3VmAZpzUcGfd0JXLfsZWxuph4qGQFeevuboD6/H0iQOG Yz7QI4hPKffD0d/av9JIAyCs+P9SLXB4LPNE1vl/YrUtLTBDb9xzvTeQOEu9pu/ay6iB iZJ3D2mdF/G8MnmgVVgggXSmRYA6akf0Ev3PcHTnZdrKwzTHFyILZiL2DRi4Z23UUe3I WuAw== Sender: swupdate@googlegroups.com X-Gm-Message-State: AElRT7EaXPRdBPYDVB0t7X7cqO2iUNkeVXwuIxZae34rO0Sz/vLMcOrR 89z5BCiBgalnk1N3BPi41qc= X-Google-Smtp-Source: AG47ELuWU5S+X7hdcSew8KAZKO+rUYurraZ7RNafiyDmSPDIwP9zVxU0TEbtFTPcswOT04sBUeAK5A== X-Received: by 10.28.11.76 with SMTP id 73mr126651wml.1.1521466467067; Mon, 19 Mar 2018 06:34:27 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: swupdate@googlegroups.com Received: by 10.223.199.7 with SMTP id k7ls3550710wrg.0.gmail; Mon, 19 Mar 2018 06:34:26 -0700 (PDT) X-Received: by 10.223.146.197 with SMTP id 63mr1068484wrn.19.1521466466568; Mon, 19 Mar 2018 06:34:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521466466; cv=none; d=google.com; s=arc-20160816; b=qW90/M2s6vDenuiNaeCE7Gpdq8eKQHIEk9vWugTchvTq8JgrdrrjKXAIvfFdh9tioS DLPLPD5yV9pFyRjg2xTnyP9PQas7lSb5Yv0ilFTONS+QIc8YV2Nj81WPkCEsCTRq5lkV li78sxHnU6YZKLyWQ38wP6JGRm8ZkIdiE/9MdC0VFVotL7yvQ5UM40U87hG7PR/kEvo4 suN0+bcKYRhjT66czfk4DKRp/RBN+FTqykf36KuUiGNWRVB1eW42o99tB4UM/eaPFCuM g6uPPGJ8BchZ6F8NKFJvoX6yjsbeP5b2GF9ujqj1cWjidLg/FRPJLo83LtDFRLJvRkld OtLw== 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=7Poum0pIYJS2yQ0PZk/fHS6F2qp1QqXkaJCOS4M6aVc=; b=BqvQ5UkIk8P47MHBqfxEviQJqdtyABfLgWvTJGwXJkcIqdF0Hy4xJHZz602GgyG4iq ayKbb9/kwDK3gZ8JShm1IYJURBj2Dmwe1Vp0kQYAbTwLQIIg6n6xTjmiIqg7Hk9Isv8q 1glKYax1ZctW9a6y3EFs625dh098Rab9GjXJRXRww3awlX4dbi3ycgHlSCyzqk2pj7Uz rbetbX9NgkstYaAA8DNQ8YpbHPwEwYn/E4Voqb8EHqmcpvjdAAMYY1ST6LyQt1JFYCal CgDU6ehGtcDoUIw3sJEX21m4aUDr4sMKJEZ27eW6KQDltZb/nmft8Vce/d+54F+Mm19Y C4VA== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of christian.storm@siemens.com designates 192.35.17.28 as permitted sender) smtp.mailfrom=christian.storm@siemens.com Received: from goliath.siemens.de (goliath.siemens.de. [192.35.17.28]) by gmr-mx.google.com with ESMTPS id b8si702wrf.5.2018.03.19.06.34.26 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 19 Mar 2018 06:34:26 -0700 (PDT) Received-SPF: pass (google.com: domain of christian.storm@siemens.com designates 192.35.17.28 as permitted sender) client-ip=192.35.17.28; Received: from mail3.siemens.de (mail3.siemens.de [139.25.208.14]) by goliath.siemens.de (8.15.2/8.15.2) with ESMTPS id w2JDYQPW026129 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Mon, 19 Mar 2018 14:34:26 +0100 Received: from MD1KR9XC.ww002.siemens.net ([139.25.69.202]) by mail3.siemens.de (8.15.2/8.15.2) with ESMTP id w2JDYPaL007717; Mon, 19 Mar 2018 14:34:25 +0100 From: Christian Storm To: swupdate@googlegroups.com Cc: Christian Storm Subject: [swupdate] [PATCH] cpio: hint error reason on copy_write() write failure Date: Mon, 19 Mar 2018 14:34:05 +0100 Message-Id: <20180319133405.2582-1-christian.storm@siemens.com> X-Mailer: git-send-email 2.16.2 X-Original-Sender: christian.storm@siemens.com X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of christian.storm@siemens.com designates 192.35.17.28 as permitted sender) smtp.mailfrom=christian.storm@siemens.com 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: , Instead of only stating the failure, give a more explicative error reason on failure using errno set by write(2). Signed-off-by: Christian Storm Reviewed-by: Stefano Babic --- core/cpio_utils.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/cpio_utils.c b/core/cpio_utils.c index 79d1c79..4b6b511 100644 --- a/core/cpio_utils.c +++ b/core/cpio_utils.c @@ -91,12 +91,12 @@ int copy_write(void *out, const void *buf, unsigned int len) if (ret < 0) { if (errno == EINTR) continue; - ERROR("cannot write %d bytes", len); + ERROR("cannot write %d bytes: %s", len, strerror(errno)); return -1; } if (ret == 0) { - ERROR("cannot write %d bytes", len); + ERROR("cannot write %d bytes: %s", len, strerror(errno)); return -1; }