summaryrefslogtreecommitdiff
path: root/scripts/sign-file.c
diff options
context:
space:
mode:
authorTianjia Zhang <tianjia.zhang@linux.alibaba.com>2022-06-27 17:21:07 +0800
committerJarkko Sakkinen <jarkko@kernel.org>2022-08-03 23:56:20 +0300
commit1a83950270684f860b15430394ea8df540d71353 (patch)
tree5d7fc8bc723f9adb5a280d6c49a9bbffe35c59b3 /scripts/sign-file.c
parent74ad4334b2ae4f83d8018487d625d1073fd3f02d (diff)
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@linux.alibaba.com> Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org> Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
Diffstat (limited to 'scripts/sign-file.c')
-rw-r--r--scripts/sign-file.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/sign-file.c b/scripts/sign-file.c
index 7434e9ea926e..598ef5465f82 100644
--- a/scripts/sign-file.c
+++ b/scripts/sign-file.c
@@ -114,7 +114,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)