[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210624104824.82616-1-tianjia.zhang@linux.alibaba.com>
Date: Thu, 24 Jun 2021 18:48:24 +0800
From: Tianjia Zhang <tianjia.zhang@...ux.alibaba.com>
To: David Howells <dhowells@...hat.com>,
David Woodhouse <dwmw2@...radead.org>,
Herbert Xu <herbert@...dor.apana.org.au>,
"David S. Miller" <davem@...emloft.net>,
Eric Biggers <ebiggers@...gle.com>,
Eric Biggers <ebiggers@...nel.org>,
Mimi Zohar <zohar@...ux.ibm.com>,
Vitaly Chikunov <vt@...linux.org>,
"Gilad Ben-Yossef" <gilad@...yossef.com>,
Pascal van Leeuwen <pvanleeuwen@...bus.com>,
James Morris <jmorris@...ei.org>,
James Morris <jamorris@...ux.microsoft.com>,
keyrings@...r.kernel.org, linux-kernel@...r.kernel.org,
Jia Zhang <zhang.jia@...ux.alibaba.com>
Cc: Tianjia Zhang <tianjia.zhang@...ux.alibaba.com>
Subject: [PATCH v2] sign-file: Fix confusing error messages
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 <tianjia.zhang@...ux.alibaba.com>
---
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
Powered by blists - more mailing lists