Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp100709pxv; Thu, 24 Jun 2021 03:51:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwMBFuAzP3i0nU0liRL4W5Fb+UQTzEHOhfR0UgcooGPFEtK0VjzFIi8EWE+g+aDQkE6LUxU X-Received: by 2002:a17:906:1c84:: with SMTP id g4mr4469473ejh.99.1624531914927; Thu, 24 Jun 2021 03:51:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624531914; cv=none; d=google.com; s=arc-20160816; b=cJQ4jy/YlJxEC+ROzibMOC01VCaTEvKBXuGdK7cNWKAQOmNeLarYqGp3R/6qnuw0VK bWbDQ9nGkPEaI0UYT7SIqVcgF8/O7g7THW4gwtkjsVDFrznDPcXqjb+4AgBcTHn6H5V0 +KTr5k2skAwPfViAJIs7jbdSjpEP29DCSKwTQMMpz+Rg29GW8hzU1sFwv+WvdnMBixDb EAWEvgvYhuNE0j0M2fp9UBWTlKNSuyjQsOF82ZRrjXWPCybtS3/CkPxeJZstCUpTs9oD 1q+BSinzCEwuoTFZbpij0UKjCjVwJU0Vi3rq6dp9qBIEDaENCQcxIAJ60QjbY5FiAIjx sXPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=H/1p8p/JtBXTWPOjD+rW08HNLbgKAJ0Ug+XsZ6kwjFM=; b=rHxcPDhtNrPUmZX7DrEtH3v9g/K2L3mSuIqJAGortakDI8UKRDetrhQL/dPJtBzY5O 3HDQj0vilsE+DJ7OK59v6L2oIUMo0Qb1pbm2U/0yGC+LC1KlAOjZuYkRE7imHuiXxBxp qu3TQldBBLY7idleqGNb79Nxe/IehpoiDNxpddr4u57OWx2AJiQpNDjKIsFhBUruy40f wzz560jeiugCRLP8zaACBc1gHg3d3zMw8Fw4uK9eqAHHT8sajEkJVK0xa9KiHOrU/C5V xDJ9QiaCzL2zLzX/QuxqhuTK367/znRV85QYRU9aEYLYZrpR4JMKwiPFkDVW4sYTsLWB r62A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l20si2880167eda.102.2021.06.24.03.51.32; Thu, 24 Jun 2021 03:51:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232164AbhFXKur (ORCPT + 99 others); Thu, 24 Jun 2021 06:50:47 -0400 Received: from out30-132.freemail.mail.aliyun.com ([115.124.30.132]:49678 "EHLO out30-132.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232127AbhFXKur (ORCPT ); Thu, 24 Jun 2021 06:50:47 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R791e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04423;MF=tianjia.zhang@linux.alibaba.com;NM=1;PH=DS;RN=16;SR=0;TI=SMTPD_---0UdWJwFH_1624531704; Received: from localhost(mailfrom:tianjia.zhang@linux.alibaba.com fp:SMTPD_---0UdWJwFH_1624531704) by smtp.aliyun-inc.com(127.0.0.1); Thu, 24 Jun 2021 18:48:25 +0800 From: Tianjia Zhang To: David Howells , David Woodhouse , Herbert Xu , "David S. Miller" , Eric Biggers , Eric Biggers , Mimi Zohar , Vitaly Chikunov , "Gilad Ben-Yossef" , Pascal van Leeuwen , James Morris , James Morris , keyrings@vger.kernel.org, linux-kernel@vger.kernel.org, Jia Zhang Cc: Tianjia Zhang Subject: [PATCH v2] sign-file: Fix confusing error messages Date: Thu, 24 Jun 2021 18:48:24 +0800 Message-Id: <20210624104824.82616-1-tianjia.zhang@linux.alibaba.com> X-Mailer: git-send-email 2.19.1.3.ge56e4f7 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When an error occurs, use errx() instead of err() to display the error message, because openssl has its own error record. When an error occurs, errno will not be changed, while err() displays the errno error message. It will cause confusion. For example, when CMS_add1_signer() fails, the following message will appear: sign-file: CMS_add1_signer: Success errx() ignores errno and does not cause such issue. Signed-off-by: Tianjia Zhang --- scripts/sign-file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/sign-file.c b/scripts/sign-file.c index fbd34b8e8f57..37d8760cb0d1 100644 --- a/scripts/sign-file.c +++ b/scripts/sign-file.c @@ -107,7 +107,7 @@ static void drain_openssl_errors(void) bool __cond = (cond); \ display_openssl_errors(__LINE__); \ if (__cond) { \ - err(1, fmt, ## __VA_ARGS__); \ + errx(1, fmt, ## __VA_ARGS__); \ } \ } while(0) -- 2.19.1.3.ge56e4f7