From: Tianjia Zhang Date: Mon, 27 Jun 2022 09:21:07 +0000 (+0800) Subject: sign-file: Fix confusing error messages X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=1a83950270684f860b15430394ea8df540d71353;p=linux.git 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 Reviewed-by: Jarkko Sakkinen Signed-off-by: Jarkko Sakkinen --- diff --git a/scripts/sign-file.c b/scripts/sign-file.c index 7434e9ea926e2..598ef5465f825 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)